changed to DataInput/OutputStreams