Have you looked at
java.io.DataOutputStream and
java.io.DataInputStream? They describe precisely-defined formats for reading and writing a variety of data types.
Note: please ignore links that look like this: DataOutputStream or DataInputStream. Unless someone (in the future) has fixed the current bug, they give links to
http://java.sun.com/javase/6/docs/api/org/omg/CORBA/DataInputStream.html and
http://java.sun.com/javase/6/docs/api/org/omg/CORBA/DataOutputStream.html. Those are definitely
not what Sun/Oracle meant in the
SCJD instructions. Those links are automatically provided by the JavaRanch forum software, and unfortunately, in this case, they're wrong. Ignore them.