public interface StreamSinkChannel extends WritableByteChannel, GatheringByteChannel, SuspendableWriteChannel
Modifier and Type | Method and Description |
---|---|
ChannelListener.Setter<? extends StreamSinkChannel> |
getCloseSetter()
Get the setter which can be used to change the close listener for this channel.
|
ChannelListener.Setter<? extends StreamSinkChannel> |
getWriteSetter()
Get the setter which can be used to change the write listener for this channel.
|
long |
transferFrom(FileChannel src,
long position,
long count)
Transfer bytes into this channel from the given file.
|
long |
transferFrom(StreamSourceChannel source,
long count,
ByteBuffer throughBuffer)
Transfers bytes from the given channel source.
|
write, write
write
awaitWritable, awaitWritable, close, flush, getWriteThread, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWrites
getWorker
getOption, setOption, supportsOption
long transferFrom(FileChannel src, long position, long count) throws IOException
FileChannel.transferTo(long, long, WritableByteChannel)
may provide a performance advantage on some platforms.src
- the file to read fromposition
- the position within the file from which the transfer is to begincount
- the number of bytes to be transferredIOException
- if an I/O error occurslong transferFrom(StreamSourceChannel source, long count, ByteBuffer throughBuffer) throws IOException
throughBuffer
parameter's buffer
space. On entry, throughBuffer
will be cleared. On exit, the buffer will be
flipped for emptying, and may be empty or may contain data. If this method returns a value less than
count
, then the remaining data in throughBuffer
may contain data read from source
which must
be written to this channel to complete the operation. Note that using a direct buffer may provide an
intermediate performance gain on platforms without zero-copy facilities.source
- the source to read fromcount
- the number of bytes to be transferredthroughBuffer
- the buffer to copy through.IOException
- if an I/O error occursChannelListener.Setter<? extends StreamSinkChannel> getWriteSetter()
getWriteSetter
in interface SuspendableWriteChannel
ChannelListener.Setter<? extends StreamSinkChannel> getCloseSetter()
getCloseSetter
in interface CloseableChannel
getCloseSetter
in interface SuspendableWriteChannel
Copyright © 2018 JBoss by Red Hat. All rights reserved.