Duplicate :
|
|
Relates :
|
DataOutputStream.writeUTF computes single bytes of the resulting UTF and writes them to the stream one byte at a time. That's okay for buffered output streams, but for ByteArrayOutputStreams (or unbuffered streams) that results in a synchronized method call per byte (at least). Similarly for DataInputStream.readUTF reading from a ByteArrayInputStream.
|