public final class FixedLengthStreamSinkConduit
extends org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
| Constructor and Description |
|---|
FixedLengthStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next,
long contentLength,
boolean configurable,
boolean propagateClose,
ConduitListener<? super FixedLengthStreamSinkConduit> finishListener)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
awaitWritable() |
void |
awaitWritable(long time,
TimeUnit timeUnit) |
boolean |
flush() |
long |
getRemaining()
Get the number of remaining bytes in this fixed length channel.
|
boolean |
isWriteResumed() |
void |
terminateWrites() |
long |
transferFrom(FileChannel src,
long position,
long count) |
long |
transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
ByteBuffer throughBuffer) |
void |
wakeupWrites() |
int |
write(ByteBuffer src) |
long |
write(ByteBuffer[] srcs,
int offset,
int length) |
getWriteThread, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, truncateWritesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic FixedLengthStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next,
long contentLength,
boolean configurable,
boolean propagateClose,
ConduitListener<? super FixedLengthStreamSinkConduit> finishListener)
next - the next channelcontentLength - the content lengthconfigurable - true if this instance should pass configuration to the nextpropagateClose - true if this instance should pass close to the nextfinishListener - the listener to call when the channel is closed or the length is reachedpublic int write(ByteBuffer src) throws IOException
write in interface org.xnio.conduits.StreamSinkConduitwrite in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic long write(ByteBuffer[] srcs, int offset, int length) throws IOException
write in interface org.xnio.conduits.StreamSinkConduitwrite in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic long transferFrom(FileChannel src, long position, long count) throws IOException
transferFrom in interface org.xnio.conduits.StreamSinkConduittransferFrom in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic long transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
ByteBuffer throughBuffer)
throws IOException
transferFrom in interface org.xnio.conduits.StreamSinkConduittransferFrom in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic boolean flush()
throws IOException
flush in interface org.xnio.conduits.SinkConduitflush in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic boolean isWriteResumed()
isWriteResumed in interface org.xnio.conduits.SinkConduitisWriteResumed in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>public void wakeupWrites()
wakeupWrites in interface org.xnio.conduits.SinkConduitwakeupWrites in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>public void terminateWrites()
throws IOException
terminateWrites in interface org.xnio.conduits.SinkConduitterminateWrites in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic void awaitWritable()
throws IOException
awaitWritable in interface org.xnio.conduits.SinkConduitawaitWritable in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic void awaitWritable(long time,
TimeUnit timeUnit)
throws IOException
awaitWritable in interface org.xnio.conduits.SinkConduitawaitWritable in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>IOExceptionpublic long getRemaining()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.