I have files in who i need to record serialized object. I open ObjectOutputStream for writing in files. If i didnt wrote nothing in file, file content get deleted. I don't want content to be deleted when i make ObjectOutputStream. Any help?
Edit:
@Provides
@ArticleSerializationOutputStream
public ObjectOutputStream getArticleObjectOutputStream(Config config) {
ObjectOutputStream out = null;
String fileName = config.getConfigValue(ARTICLE_SNAPSHOT);
try {
out = new ObjectOutputStream(new FileOutputStream(new File(fileName)));
} catch (IOException e) {
String errorMessage = String.format(IO_EXCEPTION_PROBLEM, fileName);
addError(errorMessage);
}
return out;
}
this is the code.... I use Guice!