Connects this channel's underlying socket to the given remote address.
Connects this channel's underlying socket to the given remote address.
the remote address
Reads a sequence of bytes from this channel into the given buffer.
Reads a sequence of bytes from this channel into the given buffer.
Fails with java.io.EOFException
if end-of-stream is reached.
The number of bytes read, possibly 0
Reads a sequence of bytes from this channel into the provided list of buffers, in order.
Reads a sequence of bytes from this channel into the provided list of buffers, in order.
Fails with java.io.EOFException
if end-of-stream is reached.
The number of bytes read in total, possibly 0
Reads a chunk of bytes.
Reads a chunk of bytes.
Fails with java.io.EOFException
if end-of-stream is reached.
The maximum number of bytes to be read.
The bytes read, between 0 and capacity
in size, inclusive
Reads a sequence of bytes grouped into multiple chunks.
Reads a sequence of bytes grouped into multiple chunks.
Fails with java.io.EOFException
if end-of-stream is reached.
For each int in this sequence, a chunk of that size is produced, if there is enough data in the channel.
A list with one Chunk
per input size. Some chunks may be less than the requested size if the channel does not
have enough data
Sends a datagram via this channel to the given target zio.nio.SocketAddress.
Sends a datagram via this channel to the given target zio.nio.SocketAddress.
the source buffer
the target address
the number of bytes that were sent over this channel
A sink that will write all the bytes it receives to this channel.
A sink that will write all the bytes it receives to this channel. The sink's result is the number of bytes written.
Note: This method does not work well with a channel in non-blocking mode, as it will busy-wait whenever the
channel is not ready for writes. The returned sink should be run within the context of a useBlocking
call for
correct blocking and interruption support.
Optional, overrides how to construct the buffer used to transfer bytes received by the sink to this channel. By default a heap buffer is used, but a direct buffer will usually perform better.
A ZStream
that reads from this channel.
A ZStream
that reads from this channel. Note: This method does not work well with a channel in non-blocking
mode, as it will busy-wait whenever the channel is not ready for reads. The returned stream should be run within
the context of a useBlocking
call for correct blocking and interruption support.
The stream terminates without error if the channel reaches end-of-stream.
Optional, overrides how to construct the buffer used to transfer bytes read from this channel into the stream. By default a heap buffer is used, but a direct buffer will usually perform better.
Writes a chunk of bytes.
Writes a chunk of bytes.
Multiple writes may be performed to write the entire chunk.
Writes a list of chunks, in order.
Writes a list of chunks, in order.
Multiple writes may be performed in order to write all the chunks.