The readable or writable channels returned by the public
static methods named java.nio.channels.Channels.newChannel()
return channels which are under-synchronized with respect to
concurrent read() calls.
The ReadableByteChannel specification requires that:
* If one thread initiates a read operation upon a channel
* then any other thread that attempts to initiate another read operation will
* block until the first operation is complete.
However, the read() method of the returned channel
is not synchronized and an internal byte[] field which is used for
performing IO could be left in an inconsistent state if
the method was called in parallel by multiple threads.
Similar issues apply to the write() method in the
WritableByteChannel case.
static methods named java.nio.channels.Channels.newChannel()
return channels which are under-synchronized with respect to
concurrent read() calls.
The ReadableByteChannel specification requires that:
* If one thread initiates a read operation upon a channel
* then any other thread that attempts to initiate another read operation will
* block until the first operation is complete.
However, the read() method of the returned channel
is not synchronized and an internal byte[] field which is used for
performing IO could be left in an inconsistent state if
the method was called in parallel by multiple threads.
Similar issues apply to the write() method in the
WritableByteChannel case.