I am trying to save a game state with no success.
public void saveGame(){
board = GameBoard.this;
try (
OutputStream file = new FileOutputStream(board); <---- error in this line
OutputStream buffer = new BufferedOutputStream(file);
ObjectOutput output = new ObjectOutputStream(buffer);
){
output.writeObject(game);
}
catch(IOException ex){
fLogger.log(Level.SEVERE, "Cannot save.", ex);
}
}
The error I receive for the line indicated is that it is not a suitable constructor. I'm completely lost. Can someone help me get this working or give me pointers as to where I have gone wrong please. I am not familiar with serializeable.