| Modifier and Type | Field and Description |
|---|---|
| private static final ByteBuffer | |
| private static final FileChannel |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < the connection channel type C extends ConnectedChannel, the accepting channel type A extends AcceptingChannel | Returns: the accepted channelthe accepting channel channel)Simple utility method to execute a blocking accept on an accepting channel. |
| public static < the connection channel type C extends ConnectedChannel, the accepting channel type A extends AcceptingChannel | Returns: the accepted channel, ornull if the timeout occurred before a connection was acceptedthe accepting channel channel, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking accept on an accepting channel, with a timeout. |
| public static long | Returns: the number of bytes drained, 0 if reading the channel would block, or -1 if the EOF was reachedthe channel to drain channel, long the number of bytes count)Attempt to drain the given number of bytes from the stream source channel. |
| public static long | Returns: the number of bytes drained, 0 if reading the channel would block, or -1 if the EOF was reachedthe channel to drain channel, long the number of bytes count)Attempt to drain the given number of bytes from the readable byte channel. |
| public static long | Returns: the number of bytes drained, 0 if reading the channel would block, or -1 if the EOF was reachedthe channel to drain channel, long the position to drain from position, long the number of bytes count)Attempt to drain the given number of bytes from the file channel. |
| public static void | flushBlocking(SuspendableWriteChannel
the writable channel channel)Simple utility method to execute a blocking flush on a writable channel. |
| public static boolean | Returns: true if the channel was successfully flushed, false if the timeout was reachedthe writable channel channel, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking flush on a writable channel. |
| public static < the option value type T> T | Returns: the valuethe configurable target configurable, Option<T> the option option, T the default value defaultValue)Get an option value from a configurable target. |
| public static boolean | Returns: the valuethe configurable target configurable, Option<Boolean> the option option, boolean the default value defaultValue)Get an option value from a configurable target. |
| public static int | Returns: the valuethe configurable target configurable, Option<Integer> the option option, int the default value defaultValue)Get an option value from a configurable target. |
| public static long | Returns: the valuethe configurable target configurable, Option<Long> the option option, long the default value defaultValue)Get an option value from a configurable target. |
| public static < the channel type C extends ReadableByteChannel & SuspendableReadChannel> int | Returns: the number of bytes readthe channel to read from channel, ByteBuffer the buffer into which bytes are to be transferred buffer)Simple utility method to execute a blocking read on a readable byte channel. |
| public static < the channel type C extends ReadableByteChannel & SuspendableReadChannel> int | Returns: the number of bytes readthe channel to read from channel, ByteBuffer the buffer into which bytes are to be transferred buffer, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking read on a readable byte channel with a timeout. |
| public static < the channel type C extends ScatteringByteChannel & SuspendableReadChannel> long | Returns: the number of bytes readthe channel to read from channel, ByteBuffer[] the buffers into which bytes are to be transferred buffers, int the first buffer to use offs, int the number of buffers to use len)Simple utility method to execute a blocking read on a scattering byte channel. |
| public static < the channel type C extends ScatteringByteChannel & SuspendableReadChannel> long | Returns: the number of bytes readthe channel to read from channel, ByteBuffer[] the buffers into which bytes are to be transferred buffers, int the first buffer to use offs, int the number of buffers to use len, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking read on a scattering byte channel with a timeout. |
| public static < the channel type C extends ReadableMessageChannel> int | Returns: the number of bytes readthe channel to read from channel, ByteBuffer the buffer into which bytes are to be transferred buffer)Simple utility method to execute a blocking receive on a readable message channel. |
| public static < the channel type C extends ReadableMessageChannel> int | Returns: the number of bytes readthe channel to read from channel, ByteBuffer the buffer into which bytes are to be transferred buffer, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking receive on a readable message channel with a timeout. |
| public static < the channel type C extends ReadableMessageChannel> long | Returns: the number of bytes readthe channel to read from channel, ByteBuffer[] the buffers into which bytes are to be transferred buffers, int the first buffer to use offs, int the number of buffers to use len)Simple utility method to execute a blocking receive on a readable message channel. |
| public static < the channel type C extends ReadableMessageChannel> long | Returns: the number of bytes readthe channel to read from channel, ByteBuffer[] the buffers into which bytes are to be transferred buffers, int the first buffer to use offs, int the number of buffers to use len, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking receive on a readable message channel with a timeout. |
| public static void | resumeReadsAsync(final SuspendableReadChannel
the channel to resume channel)Resume reads asynchronously. |
| public static void | resumeWritesAsync(final SuspendableWriteChannel
the channel to resume channel)Resume writes asynchronously. |
| public static < the channel type C extends WritableMessageChannel> void | sendBlocking(C
the channel to write on channel, ByteBuffer the data to write buffer)Simple utility method to execute a blocking send on a message channel. |
| public static < the channel type C extends WritableMessageChannel> boolean | Returns: the write resultthe channel to write on channel, ByteBuffer the data to write buffer, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking send on a message channel with a timeout. |
| public static < the channel type C extends WritableMessageChannel> void | sendBlocking(C
the channel to write on channel, ByteBuffer[] the data to write buffers, int the index of the first buffer to write offs, int the number of buffers to write len)Simple utility method to execute a blocking gathering send on a message channel. |
| public static < the channel type C extends WritableMessageChannel> boolean | Returns: true if the message was written before the timeoutthe channel to write on channel, ByteBuffer[] the data to write buffers, int the index of the first buffer to write offs, int the number of buffers to write len, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking gathering send on a message channel with a timeout. |
| public static < the channel type T extends AcceptingChannel | setAcceptListener(T
the channel channel, ChannelListener<? super T> the listener to set listener)Set the accept listener for a channel (type-safe). |
| public static < the channel type T extends CloseableChannel> void | setCloseListener(T
the channel channel, ChannelListener<? super T> the listener to set listener)Set the close listener for a channel (type-safe). |
| public static < the channel type T extends SuspendableReadChannel> void | setReadListener(T
the channel channel, ChannelListener<? super T> the listener to set listener)Set the read listener for a channel (type-safe). |
| public static < the channel type T extends SuspendableWriteChannel> void | setWriteListener(T
the channel channel, ChannelListener<? super T> the listener to set listener)Set the write listener for a channel (type-safe). |
| public static void | shutdownWritesBlocking(SuspendableWriteChannel
the writable channel channel)Simple utility method to execute a blocking write shutdown on a writable channel. |
| public static boolean | Returns: true if the channel was successfully flushed, false if the timeout was reachedthe writable channel channel, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking write shutdown on a writable channel. |
| public static void | transferBlocking(StreamSinkChannel
the destination channel destination, FileChannel the source file channel source, long the start position in the source file startPosition, final long the number of bytes to transfer count)Transfer bytes between two channels efficiently, blocking if necessary. |
| public static void | transferBlocking(FileChannel
the destination file channel destination, StreamSourceChannel the source channel source, long the start position in the destination file startPosition, final long the number of bytes to transfer count)Transfer bytes between two channels efficiently, blocking if necessary. |
| public static long | Returns: the number of bytes actually transferred (will be fewer thancount if EOF was reached)the destination channel destination, StreamSourceChannel the source channel source, ByteBuffer the buffer to transfer through, throughBuffer, long the number of bytes to transfer count)Transfer bytes between two channels efficiently, blocking if necessary. |
| public static < the type to unwrap T extends Channel> T | |
| public static ByteChannel | Returns: the wrapped channelthe original original)Create a wrapper for a byte channel which does not expose other methods. |
| public static < the channel type C extends WritableByteChannel & SuspendableWriteChannel> int | Returns: the number of bytes writtenthe channel to write on channel, ByteBuffer the data to write buffer)Simple utility method to execute a blocking write on a byte channel. |
| public static < the channel type C extends WritableByteChannel & SuspendableWriteChannel> int | Returns: the number of bytes writtenthe channel to write on channel, ByteBuffer the data to write buffer, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking write on a byte channel with a timeout. |
| public static < the channel type C extends GatheringByteChannel & SuspendableWriteChannel> long | Returns: the number of bytes writtenthe channel to write on channel, ByteBuffer[] the data to write buffers, int the index of the first buffer to write offs, int the number of buffers to write len)Simple utility method to execute a blocking write on a gathering byte channel. |
| public static < the channel type C extends GatheringByteChannel & SuspendableWriteChannel> long | Returns: the number of bytes writtenthe channel to write on channel, ByteBuffer[] the data to write buffers, int the index of the first buffer to write offs, int the number of buffers to write len, long the amount of time to wait time, TimeUnit the unit of time to wait unit)Simple utility method to execute a blocking write on a gathering byte channel with a timeout. |
| public static int | Returns: The number of bytes writtenThe channel channel, ByteBuffer The buffer src)Writes out the data in the buffer to the channel. |
| public static long | Returns: The number of bytes writtenThe channel channel, ByteBuffer[] The buffers srcs, int The offset into the srcs array offset, int The number buffers to write length)Writes out the data in the buffer to the channel. |