I have a files folder with MO.data that I want to save an object to.
try{
FileOutputStream t = new FileOutputStream(String.valueOf(GameReader.class.getResourceAsStream("MO.data")));
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(t));
out.writeObject(map);
out.close();
System.out.println("File saved and closed!");
return true;
}catch(IOException ioe){
System.err.print(ioe);
return false;
}
I have: src/files/GameReader.class and src/files/MO.data
My class I'm working from is located in src/logic/saver.class
However, it keeps saving it to a file: java.io.BufferedInputStream@11b1857c in src/java.io.BufferedInputStream@11b1857c
What am I doing wrong?