public final class Conduits extends Object
Constructor and Description |
---|
Conduits() |
Modifier and Type | Method and Description |
---|---|
static long |
transfer(ReadableByteChannel source,
long count,
ByteBuffer throughBuffer,
StreamSinkConduit sink)
Platform-independent channel-to-channel transfer method.
|
static long |
transfer(StreamSourceConduit source,
long count,
ByteBuffer throughBuffer,
WritableByteChannel sink)
Platform-independent channel-to-channel transfer method.
|
public static long transfer(StreamSourceConduit source, long count, ByteBuffer throughBuffer, WritableByteChannel sink) throws IOException
read
and write
operations
to move bytes from the source
channel to the sink
channel. After this call, the throughBuffer
should be checked for remaining bytes; if there are any, they should be written to the sink
channel before
proceeding. This method may be used with NIO channels, XNIO channels, or a combination of the two.
If either or both of the given channels are blocking channels, then this method may block.
source
- the source channel to read bytes fromcount
- the number of bytes to transfer (must be >= 0L
)throughBuffer
- the buffer to transfer through (must not be null
)sink
- the sink channel to write bytes toIOException
- if an I/O error occurs during the transfer of bytespublic static long transfer(ReadableByteChannel source, long count, ByteBuffer throughBuffer, StreamSinkConduit sink) throws IOException
read
and write
operations
to move bytes from the source
channel to the sink
channel. After this call, the throughBuffer
should be checked for remaining bytes; if there are any, they should be written to the sink
channel before
proceeding. This method may be used with NIO channels, XNIO channels, or a combination of the two.
If either or both of the given channels are blocking channels, then this method may block.
source
- the source channel to read bytes fromcount
- the number of bytes to transfer (must be >= 0L
)throughBuffer
- the buffer to transfer through (must not be null
)sink
- the sink channel to write bytes toIOException
- if an I/O error occurs during the transfer of bytesCopyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.