Top Description Fields Constructors Methods
org.xnio.channels

public final Class SplitStreamSinkChannel

extends Object
implements StreamSinkChannel, WriteListenerSettable<SplitStreamSinkChannel>, CloseListenerSettable<SplitStreamSinkChannel>
Class Inheritance
All Implemented Interfaces
org.xnio.channels.CloseListenerSettable, org.xnio.channels.WriteListenerSettable, org.xnio.channels.StreamSinkChannel, org.xnio.channels.SuspendableWriteChannel, org.xnio.channels.CloseableChannel, org.xnio.channels.Configurable, java.nio.channels.InterruptibleChannel, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable, java.nio.channels.GatheringByteChannel, java.nio.channels.WritableByteChannel
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.FileChannel, java.util.concurrent.TimeUnit, java.util.concurrent.atomic.AtomicIntegerFieldUpdater, org.xnio.ChannelListener, .Option, .XnioExecutor, .XnioIoThread, .XnioWorker

A half-duplex (write side) wrapper for a full-duplex channel.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private ChannelListener<? super SplitStreamSinkChannel>
private final StreamSinkChannel
private static final int
private static final int
private static final int
private volatile int
private static final AtomicIntegerFieldUpdater<SplitStreamSinkChannel>
private ChannelListener<? super SplitStreamSinkChannel>

Constructor Summary

AccessConstructor and Description
public
SplitStreamSinkChannel(final StreamSinkChannel
the delegate channel
delegate
,
boolean
true to delegate configuration, false otherwise
delegateConfig
)

Construct a new instance.

public
SplitStreamSinkChannel(final StreamSinkChannel
the delegate channel
delegate
)

Construct a new instance which does not delegate configuration.

Method Summary

Modifier and TypeMethod and Description
public void
awaitWritable()

Implements org.xnio.channels.SuspendableWriteChannel.awaitWritable.

Block until this channel becomes writable again.

public void
awaitWritable(final long
the time to wait
time
,
final TimeUnit
the time unit
timeUnit
)

Implements org.xnio.channels.SuspendableWriteChannel.awaitWritable.

Block until this channel becomes writable again, or until the timeout expires.

public void
public boolean
flush()

Implements org.xnio.channels.SuspendableWriteChannel.flush.

Flush any waiting partial send or write.

public ChannelListener<? super SplitStreamSinkChannel>
public ChannelListener.Setter<? extends SplitStreamSinkChannel>
getCloseSetter()

Implements org.xnio.channels.StreamSinkChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public XnioIoThread
getIoThread()

Implements org.xnio.channels.CloseableChannel.getIoThread.

Get the I/O thread associated with this channel.

public <T> T
getOption(final Option<T>
the option to get
option
)

Implements org.xnio.channels.Configurable.getOption.

Get the value of a channel option.

public XnioWorker
getWorker()

Implements org.xnio.channels.CloseableChannel.getWorker.

Get the worker for this channel.

public ChannelListener<? super SplitStreamSinkChannel>
public ChannelListener.Setter<? extends SplitStreamSinkChannel>
getWriteSetter()

Implements org.xnio.channels.StreamSinkChannel.getWriteSetter.

Get the setter which can be used to change the write listener for this channel.

public XnioExecutor
getWriteThread()

Implements org.xnio.channels.SuspendableWriteChannel.getWriteThread.

Deprecated

Get the write thread for this channel.

public boolean
public boolean
isWriteResumed()

Implements org.xnio.channels.SuspendableWriteChannel.isWriteResumed.

Determine whether writes are resumed.

public void
resumeWrites()

Implements org.xnio.channels.SuspendableWriteChannel.resumeWrites.

Resume writes on this channel.

public void
setCloseListener(final ChannelListener<? super SplitStreamSinkChannel>
the close listener
closeListener
)

Implements org.xnio.channels.CloseListenerSettable.setCloseListener.

Set the close listener.

public <T> T
setOption(final Option<T>
the option to set
option
,
final T
the value of the option to set
value
)

Implements org.xnio.channels.Configurable.setOption.

Set an option for this channel.

public void
setWriteListener(final ChannelListener<? super SplitStreamSinkChannel>
the write listener
writeListener
)

Implements org.xnio.channels.WriteListenerSettable.setWriteListener.

Set the write listener.

public void
shutdownWrites()

Implements org.xnio.channels.SuspendableWriteChannel.shutdownWrites.

Indicate that writing is complete for this channel.

public boolean
supportsOption(final Option<?>
the option
option
)

Implements org.xnio.channels.Configurable.supportsOption.

Determine whether an option is supported on this channel.

public void
suspendWrites()

Implements org.xnio.channels.SuspendableWriteChannel.suspendWrites.

Suspend further write notifications on this channel.

public long
transferFrom(final FileChannel
the file to read from
src
,
final long
the position within the file from which the transfer is to begin
position
,
final long
the number of bytes to be transferred
count
)

Implements org.xnio.channels.StreamSinkChannel.transferFrom.

Transfer bytes into this channel from the given file.

public long
transferFrom(final StreamSourceChannel
the source to read from
source
,
final long
the number of bytes to be transferred
count
,
final ByteBuffer
the buffer to copy through.
throughBuffer
)

Implements org.xnio.channels.StreamSinkChannel.transferFrom.

Transfers bytes from the given channel source.

public void
wakeupWrites()

Implements org.xnio.channels.SuspendableWriteChannel.wakeupWrites.

Resume writes on this channel, and force the write listener to be triggered even if the channel isn't actually writable.

public int
write(final ByteBuffer
The buffer from which bytes are to be retrieved
src
)

Implements java.nio.channels.WritableByteChannel.write.

Writes a sequence of bytes to this channel from the given buffer.

public long
write(final ByteBuffer[]
The buffers from which bytes are to be retrieved
srcs
,
final int
The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than srcs.length
offset
,
final int
The maximum number of buffers to be accessed; must be non-negative and no larger than srcs.length - offset
length
)

Implements java.nio.channels.GatheringByteChannel.write.

Writes a sequence of bytes to this channel from a subsequence of the given buffers.

public long
write(final ByteBuffer[]
The buffers from which bytes are to be retrieved
srcs
)

Implements java.nio.channels.GatheringByteChannel.write.

Writes a sequence of bytes to this channel from the given buffers.

public int
writeFinal(ByteBuffer
The data to write
src
)

Implements org.xnio.channels.StreamSinkChannel.writeFinal.

Writes some data to the channel, with the same semantics as write(java.nio.ByteBuffer).

public long
writeFinal(ByteBuffer[]
The buffers from which bytes are to be retrieved
srcs
,
int
The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than srcs.length
offset
,
int
The maximum number of buffers to be accessed; must be non-negative and no larger than srcs.length - offset
length
)

Implements org.xnio.channels.StreamSinkChannel.writeFinal.

Writes some data to the channel, with the same semantics as write(java.nio.ByteBuffer[], int, int).

public long
writeFinal(ByteBuffer[]
The buffers from which bytes are to be retrieved
srcs
)

Implements org.xnio.channels.StreamSinkChannel.writeFinal.

Writes some data to the channel, with the same semantics as write(java.nio.ByteBuffer[]).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

closeListenerback to summary
private ChannelListener<? super SplitStreamSinkChannel> closeListener
delegateback to summary
private final StreamSinkChannel delegate
FLAG_CLOSE_COMPback to summary
private static final int FLAG_CLOSE_COMP
FLAG_CLOSE_REQback to summary
private static final int FLAG_CLOSE_REQ
FLAG_DELEGATE_CONFIGback to summary
private static final int FLAG_DELEGATE_CONFIG
stateback to summary
private volatile int state
stateUpdaterback to summary
private static final AtomicIntegerFieldUpdater<SplitStreamSinkChannel> stateUpdater
writeListenerback to summary
private ChannelListener<? super SplitStreamSinkChannel> writeListener

Constructor Detail

SplitStreamSinkChannelback to summary
public SplitStreamSinkChannel(final StreamSinkChannel delegate, boolean delegateConfig)

Construct a new instance.

Parameters
delegate:StreamSinkChannel

the delegate channel

delegateConfig:boolean

true to delegate configuration, false otherwise

SplitStreamSinkChannelback to summary
public SplitStreamSinkChannel(final StreamSinkChannel delegate)

Construct a new instance which does not delegate configuration.

Parameters
delegate:StreamSinkChannel

the delegate channel

Method Detail

awaitWritableback to summary
public void awaitWritable() throws IOException

Implements org.xnio.channels.SuspendableWriteChannel.awaitWritable.

Doc from org.xnio.channels.SuspendableWriteChannel.awaitWritable.

Block until this channel becomes writable again. This method may return spuriously before the channel becomes writable.

Exceptions
IOException:
if an I/O error occurs
awaitWritableback to summary
public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException

Implements org.xnio.channels.SuspendableWriteChannel.awaitWritable.

Doc from org.xnio.channels.SuspendableWriteChannel.awaitWritable.

Block until this channel becomes writable again, or until the timeout expires. This method may return spuriously before the channel becomes writable or the timeout expires.

Parameters
time:long

the time to wait

timeUnit:TimeUnit

the time unit

Exceptions
IOException:
if an I/O error occurs
closeback to summary
public void close() throws IOException

Implements java.nio.channels.Channel.close, org.xnio.channels.SuspendableWriteChannel.close.

Doc from org.xnio.channels.SuspendableWriteChannel.close.

Close this channel. If data has been written but not flushed, that data may be discarded, depending on the channel implementation. When a channel is closed, its close listener is invoked. Invoking this method more than once has no additional effect.

Exceptions
IOException:
if the close failed
flushback to summary
public boolean flush() throws IOException

Implements org.xnio.channels.SuspendableWriteChannel.flush.

Doc from org.xnio.channels.SuspendableWriteChannel.flush.

Flush any waiting partial send or write. If there is no data to flush, or if the flush completed successfully, this method will return true. If there is data to flush which cannot be immediately written, this method will return false. If this method returns true after shutdownWrites() was called on this channel, the write listener will no longer be invoked on this channel. If this is case and additionally this is a write-only channel or the read side was previously shut down, then the channel will automatically be closed.

Returns:boolean

true if the message was flushed, or false if the result would block

Exceptions
IOException:
if an I/O error occurs
getCloseListenerback to summary
public ChannelListener<? super SplitStreamSinkChannel> getCloseListener()

Implements org.xnio.channels.CloseListenerSettable.getCloseListener.

Doc from org.xnio.channels.CloseListenerSettable.getCloseListener.

Get the close listener.

Returns:ChannelListener<? super SplitStreamSinkChannel>

the close listener

getCloseSetterback to summary
public ChannelListener.Setter<? extends SplitStreamSinkChannel> getCloseSetter()

Implements org.xnio.channels.StreamSinkChannel.getCloseSetter.

Doc from org.xnio.channels.StreamSinkChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.

Returns:ChannelListener.Setter<? extends SplitStreamSinkChannel>

Doc from org.xnio.channels.CloseableChannel.getCloseSetter.

the setter

getIoThreadback to summary
public XnioIoThread getIoThread()

Implements org.xnio.channels.CloseableChannel.getIoThread.

Doc from org.xnio.channels.CloseableChannel.getIoThread.

Get the I/O thread associated with this channel.

Returns:XnioIoThread

the I/O thread associated with this channel

getOptionback to summary
public <T> T getOption(final Option<T> option) throws IOException

Implements org.xnio.channels.Configurable.getOption.

Doc from org.xnio.channels.Configurable.getOption.

Get the value of a channel option.

Parameters
<T>
the type of the option value
option:Option<T>

the option to get

Returns:T

the value of the option, or null if it is not set

Exceptions
IOException:
if an I/O error occurred when reading the option
getWorkerback to summary
public XnioWorker getWorker()

Implements org.xnio.channels.CloseableChannel.getWorker.

Doc from org.xnio.channels.CloseableChannel.getWorker.

Get the worker for this channel.

Returns:XnioWorker

the worker

getWriteListenerback to summary
public ChannelListener<? super SplitStreamSinkChannel> getWriteListener()

Implements org.xnio.channels.WriteListenerSettable.getWriteListener.

Doc from org.xnio.channels.WriteListenerSettable.getWriteListener.

Get the write listener.

Returns:ChannelListener<? super SplitStreamSinkChannel>

the write listener

getWriteSetterback to summary
public ChannelListener.Setter<? extends SplitStreamSinkChannel> getWriteSetter()

Implements org.xnio.channels.StreamSinkChannel.getWriteSetter.

Doc from org.xnio.channels.StreamSinkChannel.getWriteSetter.

Get the setter which can be used to change the write listener for this channel.

Returns:ChannelListener.Setter<? extends SplitStreamSinkChannel>

Doc from org.xnio.channels.SuspendableWriteChannel.getWriteSetter.

the setter

getWriteThreadback to summary
public XnioExecutor getWriteThread()

Implements org.xnio.channels.SuspendableWriteChannel.getWriteThread.

Doc from org.xnio.channels.SuspendableWriteChannel.getWriteThread.

Deprecated

Get the write thread for this channel.

Returns:XnioExecutor

the thread, or null if none is configured or available

Annotations
@Deprecated
isOpenback to summary
public boolean isOpen()

Implements java.nio.channels.Channel.isOpen, org.xnio.channels.SuspendableWriteChannel.isOpen.

Doc from org.xnio.channels.SuspendableWriteChannel.isOpen.

Determine whether this channel is open. This method will return false if all directions are shut down, even if there is unflushed write data pending.

Returns:boolean

true if the channel is open, false otherwise

isWriteResumedback to summary
public boolean isWriteResumed()

Implements org.xnio.channels.SuspendableWriteChannel.isWriteResumed.

Doc from org.xnio.channels.SuspendableWriteChannel.isWriteResumed.

Determine whether writes are resumed.

Returns:boolean

true if writes are resumed, false if writes are suspended

resumeWritesback to summary
public void resumeWrites()

Implements org.xnio.channels.SuspendableWriteChannel.resumeWrites.

Doc from org.xnio.channels.SuspendableWriteChannel.resumeWrites.

Resume writes on this channel. The write listener will be called as soon as the channel becomes writable.

setCloseListenerback to summary
public void setCloseListener(final ChannelListener<? super SplitStreamSinkChannel> closeListener)

Implements org.xnio.channels.CloseListenerSettable.setCloseListener.

Doc from org.xnio.channels.CloseListenerSettable.setCloseListener.

Set the close listener.

Parameters
closeListener:ChannelListener<? super SplitStreamSinkChannel>

the close listener

setOptionback to summary
public <T> T setOption(final Option<T> option, final T value) throws IllegalArgumentException, IOException

Implements org.xnio.channels.Configurable.setOption.

Doc from org.xnio.channels.Configurable.setOption.

Set an option for this channel. Unsupported options are ignored.

Parameters
<T>
the type of the option value
option:Option<T>

the option to set

value:T

the value of the option to set

Returns:T

the previous option value, if any

Exceptions
IllegalArgumentException:
if the value is not acceptable for this option
IOException:
if an I/O error occurred when modifying the option
setWriteListenerback to summary
public void setWriteListener(final ChannelListener<? super SplitStreamSinkChannel> writeListener)

Implements org.xnio.channels.WriteListenerSettable.setWriteListener.

Doc from org.xnio.channels.WriteListenerSettable.setWriteListener.

Set the write listener.

Parameters
writeListener:ChannelListener<? super SplitStreamSinkChannel>

the write listener

shutdownWritesback to summary
public void shutdownWrites() throws IOException

Implements org.xnio.channels.SuspendableWriteChannel.shutdownWrites.

Doc from org.xnio.channels.SuspendableWriteChannel.shutdownWrites.

Indicate that writing is complete for this channel. Further attempts to write data to this channel after this method is invoked will result in an exception. If this method was already called, calling this method again will have no additional effect. After this method is called, any remaining data still must be flushed out via the flush() method; once this is done, if the read side of the channel was shut down, the channel will automatically close.

Exceptions
IOException:
if an I/O error occurs
supportsOptionback to summary
public boolean supportsOption(final Option<?> option)

Implements org.xnio.channels.Configurable.supportsOption.

Doc from org.xnio.channels.Configurable.supportsOption.

Determine whether an option is supported on this channel.

Parameters
option:Option<?>

the option

Returns:boolean

true if it is supported

suspendWritesback to summary
public void suspendWrites()

Implements org.xnio.channels.SuspendableWriteChannel.suspendWrites.

Doc from org.xnio.channels.SuspendableWriteChannel.suspendWrites.

Suspend further write notifications on this channel.

transferFromback to summary
public long transferFrom(final FileChannel src, final long position, final long count) throws IOException

Implements org.xnio.channels.StreamSinkChannel.transferFrom.

Doc from org.xnio.channels.StreamSinkChannel.transferFrom.

Transfer bytes into this channel from the given file. Using this method in preference to FileChannel#transferTo(long, long, WritableByteChannel) may provide a performance advantage on some platforms.

If the current thread is interrupted when this method is called, it may throw a java.io.InterruptedIOException; however, if this exception is thrown, the java.io.InterruptedIOException#bytesTransferred field is guaranteed to be 0.

Parameters
src:FileChannel

the file to read from

position:long

the position within the file from which the transfer is to begin

count:long

the number of bytes to be transferred

Returns:long

the number of bytes (possibly 0) that were actually transferred

Exceptions
IOException:
if an I/O error occurs
transferFromback to summary
public long transferFrom(final StreamSourceChannel source, final long count, final ByteBuffer throughBuffer) throws IOException

Implements org.xnio.channels.StreamSinkChannel.transferFrom.

Doc from org.xnio.channels.StreamSinkChannel.transferFrom.

Transfers bytes from the given channel source. On some platforms, this may avoid copying bytes between user and kernel space. On other platforms, bytes are passed through the 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.

If the current thread is interrupted when this method is called, it may throw a java.io.InterruptedIOException; however, if this exception is thrown, the java.io.InterruptedIOException#bytesTransferred field is guaranteed to be 0.

Parameters
source:StreamSourceChannel

the source to read from

count:long

the number of bytes to be transferred

throughBuffer:ByteBuffer

the buffer to copy through.

Returns:long

the number of bytes (possibly 0) that were actually transferred, or -1 if the end of input was reached

Exceptions
IOException:
if an I/O error occurs
wakeupWritesback to summary
public void wakeupWrites()

Implements org.xnio.channels.SuspendableWriteChannel.wakeupWrites.

Doc from org.xnio.channels.SuspendableWriteChannel.wakeupWrites.

Resume writes on this channel, and force the write listener to be triggered even if the channel isn't actually writable.

writeback to summary
public int write(final ByteBuffer src) throws IOException

Implements java.nio.channels.WritableByteChannel.write.

Doc from java.nio.channels.WritableByteChannel.write.

Writes a sequence of bytes to this channel from the given buffer.

An attempt is made to write up to r bytes to the channel, where r is the number of bytes remaining in the buffer, that is, src.remaining(), at the moment this method is invoked.

Suppose that a byte sequence of length n is written, where 0 <= n <= r. This byte sequence will be transferred from the buffer starting at index p, where p is the buffer's position at the moment this method is invoked; the index of the last byte written will be p + n - 1. Upon return the buffer's position will be equal to p + n; its limit will not have changed.

Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer.

This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.

Parameters
src:ByteBuffer

The buffer from which bytes are to be retrieved

Returns:int

The number of bytes written, possibly zero

Exceptions
IOException:
If some other I/O error occurs
writeback to summary
public long write(final ByteBuffer[] srcs, final int offset, final int length) throws IOException

Implements java.nio.channels.GatheringByteChannel.write.

Doc from java.nio.channels.GatheringByteChannel.write.

Writes a sequence of bytes to this channel from a subsequence of the given buffers.

An attempt is made to write up to r bytes to this channel, where r is the total number of bytes remaining in the specified subsequence of the given buffer array, that is,

srcs[offset].remaining() + srcs[offset+1].remaining() + ... + srcs[offset+length-1].remaining()
srcs[offset].remaining()
    + srcs[offset+1].remaining()
    + ... + srcs[offset+length-1].remaining()
at the moment that this method is invoked.

Suppose that a byte sequence of length n is written, where 0 <= n <= r. Up to the first srcs[offset].remaining() bytes of this sequence are written from buffer srcs[offset], up to the next srcs[offset+1].remaining() bytes are written from buffer srcs[offset+1], and so forth, until the entire byte sequence is written. As many bytes as possible are written from each buffer, hence the final position of each updated buffer, except the last updated buffer, is guaranteed to be equal to that buffer's limit.

Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer.

This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.

Parameters
srcs:ByteBuffer[]

The buffers from which bytes are to be retrieved

offset:int

The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than srcs.length

length:int

The maximum number of buffers to be accessed; must be non-negative and no larger than srcs.length - offset

Returns:long

The number of bytes written, possibly zero

Exceptions
IOException:
If some other I/O error occurs
writeback to summary
public long write(final ByteBuffer[] srcs) throws IOException

Implements java.nio.channels.GatheringByteChannel.write.

Doc from java.nio.channels.GatheringByteChannel.write.

Writes a sequence of bytes to this channel from the given buffers.

An invocation of this method of the form c.write(srcs) behaves in exactly the same manner as the invocation

c.write(srcs, 0, srcs.length);
c.write(srcs, 0, srcs.length);
Parameters
srcs:ByteBuffer[]

The buffers from which bytes are to be retrieved

Returns:long

The number of bytes written, possibly zero

Exceptions
IOException:
If some other I/O error occurs
writeFinalback to summary
public int writeFinal(ByteBuffer src) throws IOException

Implements org.xnio.channels.StreamSinkChannel.writeFinal.

Doc from org.xnio.channels.StreamSinkChannel.writeFinal.

Writes some data to the channel, with the same semantics as write(java.nio.ByteBuffer). If all the data is written out then the channel will have its writes shutdown. Semantically this method is equivalent to: int rem = src.remaining(); int written = channel.write(src); if(written == rem) { channel.shutdownWrites() } If an exception is thrown the caller is still responsible for closing the channel.

Parameters
src:ByteBuffer

The data to write

Returns:int

The amount of data that was actually written.

Annotations
@Override
writeFinalback to summary
public long writeFinal(ByteBuffer[] srcs, int offset, int length) throws IOException

Implements org.xnio.channels.StreamSinkChannel.writeFinal.

Doc from org.xnio.channels.StreamSinkChannel.writeFinal.

Writes some data to the channel, with the same semantics as write(java.nio.ByteBuffer[], int, int). If all the data is written out then the channel will have its writes shutdown. If an exception is thrown the caller is still responsible for closing the channel.

Parameters
srcs:ByteBuffer[]

The buffers from which bytes are to be retrieved

offset:int

The offset within the buffer array of the first buffer from which bytes are to be retrieved; must be non-negative and no larger than srcs.length

length:int

The maximum number of buffers to be accessed; must be non-negative and no larger than srcs.length - offset

Returns:long

The amount of data that was actually written

Annotations
@Override
writeFinalback to summary
public long writeFinal(ByteBuffer[] srcs) throws IOException

Implements org.xnio.channels.StreamSinkChannel.writeFinal.

Doc from org.xnio.channels.StreamSinkChannel.writeFinal.

Writes some data to the channel, with the same semantics as write(java.nio.ByteBuffer[]). If all the data is written out then the channel will have its writes shutdown. If an exception is thrown the caller is still responsible for closing the channel.

Parameters
srcs:ByteBuffer[]

The buffers from which bytes are to be retrieved

Returns:long

The amount of data that was actually written

Annotations
@Override