I am obliged to open a ObjectOutputStream
, then write an object an finally close the stream. I do that multiple times using the following code :
// try-with-statement is very practical
try(FileOutputStream fos = new FileOutputStream("G.txt") ;
ObjectOutputStream oos = new ObjectOutputStream(fos);){
oos.writeObject(v);
} catch (IOException e) {
e.printStackTrace();
}
But what I want is to append the objects serialized in the "G.txt" ? how to do that please ? I can't figure that out ?