Closed DeiversonMAP closed 2 years ago
I'm having problem in the reading of serialization of a AST object here is my methods of wirte and read:
private void writeBinFile(APEG data) throws IOException { try( ObjectOutputStream oos = new ObjectOutputStream( new FileOutputStream(pth.getRelativePath())) ){ oos.writeObject(data); } catch (IOException e){ return; } } private APEG readBinFile() throws IOException { try( ObjectInputStream ois = new ObjectInputStream( new FileInputStream(pth.getRelativePath()) ) ) { // System.out.println( ois.readObject().toString()); System.out.println("entrou aqui"); APEG a = (APEG) ois.readObject(); System.out.println("entrou aqui2"); return a; } catch (Exception e){ e.printStackTrace(); return null; } }
The root class have the Serializable implemententation as the SymInfo class as well And I'm getting the following error :
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "apeg" is null
To solve it was necessary to implement the Serializable class in the CharInterval class
I'm having problem in the reading of serialization of a AST object here is my methods of wirte and read:
The root class have the Serializable implemententation as the SymInfo class as well And I'm getting the following error :
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "apeg" is null