use DataInput/DataOutput instead of Input/OutputStream