I am writing to a binary file. My poblem is that i want that the next time it write to the file it will write on a new line. What can i do? Thanks a lot.
This is the piece of code that writes to the file:
This is the piece of code that writes to the file:
Code:
File aFile = new File( "players.dat" );
// create an output stream to the file
FileOutputStream aFileOutStream = new FileOutputStream ( aFile, true );
// create a data output stream to the file output stream
DataOutputStream aDataOutStream = new DataOutputStream ( aFileOutStream );
// write data to file
aDataOutStream.writeUTF(player);
aDataOutStream.writeUTF(String.valueOf(percent) );
aDataOutStream.writeUTF(type );
aFileOutStream.close();
Comment