Witam!
taki kod zapisuje obiekt do pliku
ObjectOutputStream zapis = new ObjectOutputStream(new FileOutputStream("baza.txt"));
zapis.writeObject(os);
zapis.close();
Czy można dopisać do pliku kolejny obiekt ? może istnieje jakaś metoda typu append?
Pozdrawiam!
Zapisywanie obiektów do pliku
Re: Zapisywanie obiektów do pliku
źródłoThe method writeObject is used to write an object to the stream. Any object, including Strings and arrays, is written with writeObject. Multiple objects or primitives can be written to the stream. The objects must be read back from the corresponding ObjectInputstream with the same types and in the same order as they were written.
Po prostu korzysta się ponownie z metody writeObject