org.xnio.conduits.Conduit
, org.xnio.conduits.SinkConduit
, org.xnio.conduits.StreamSinkConduit
public class AbstractFramedStreamSinkConduit
extends org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
When a write takes place all frames are attempted to be written out at once via a gathering write. Frames can be
queued via queueFrame(io.undertow.conduits.AbstractFramedStreamSinkConduit.FrameCallBack, java.nio.ByteBuffer...)
.
Modifier and Type | Class | Description |
---|---|---|
static interface |
AbstractFramedStreamSinkConduit.FrameCallBack |
Interface that is called when a frame event takes place.
|
protected static class |
AbstractFramedStreamSinkConduit.PooledBufferFrameCallback |
|
protected static class |
AbstractFramedStreamSinkConduit.PooledBuffersFrameCallback |
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractFramedStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
doTerminateWrites() |
|
protected void |
finished() |
|
protected boolean |
flushQueuedData() |
|
protected boolean |
isWritesTerminated() |
|
protected void |
queueCloseFrames() |
|
protected long |
queuedDataLength() |
|
protected void |
queueFrame(AbstractFramedStreamSinkConduit.FrameCallBack callback,
java.nio.ByteBuffer... data) |
Queues a frame for sending.
|
void |
terminateWrites() |
|
long |
transferFrom(java.nio.channels.FileChannel src,
long position,
long count) |
|
long |
transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
java.nio.ByteBuffer throughBuffer) |
|
void |
truncateWrites() |
|
int |
write(java.nio.ByteBuffer src) |
|
long |
write(java.nio.ByteBuffer[] srcs,
int offs,
int len) |
|
int |
writeFinal(java.nio.ByteBuffer src) |
|
long |
writeFinal(java.nio.ByteBuffer[] srcs,
int offs,
int len) |
awaitWritable, awaitWritable, flush, getWriteThread, isWriteResumed, isWriteShutdown, resumeWrites, setWriteReadyHandler, suspendWrites, wakeupWrites
protected AbstractFramedStreamSinkConduit(org.xnio.conduits.StreamSinkConduit next)
next
- the delegate conduit to setprotected void queueFrame(AbstractFramedStreamSinkConduit.FrameCallBack callback, java.nio.ByteBuffer... data)
callback
- data
- public long transferFrom(java.nio.channels.FileChannel src, long position, long count) throws java.io.IOException
transferFrom
in interface org.xnio.conduits.StreamSinkConduit
transferFrom
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public long transferFrom(org.xnio.channels.StreamSourceChannel source, long count, java.nio.ByteBuffer throughBuffer) throws java.io.IOException
transferFrom
in interface org.xnio.conduits.StreamSinkConduit
transferFrom
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface org.xnio.conduits.StreamSinkConduit
write
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public long write(java.nio.ByteBuffer[] srcs, int offs, int len) throws java.io.IOException
write
in interface org.xnio.conduits.StreamSinkConduit
write
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public int writeFinal(java.nio.ByteBuffer src) throws java.io.IOException
writeFinal
in interface org.xnio.conduits.StreamSinkConduit
writeFinal
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
public long writeFinal(java.nio.ByteBuffer[] srcs, int offs, int len) throws java.io.IOException
writeFinal
in interface org.xnio.conduits.StreamSinkConduit
writeFinal
in class org.xnio.conduits.AbstractStreamSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
protected long queuedDataLength()
public void terminateWrites() throws java.io.IOException
terminateWrites
in interface org.xnio.conduits.SinkConduit
terminateWrites
in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
protected void doTerminateWrites() throws java.io.IOException
java.io.IOException
protected boolean flushQueuedData() throws java.io.IOException
java.io.IOException
public void truncateWrites() throws java.io.IOException
truncateWrites
in interface org.xnio.conduits.SinkConduit
truncateWrites
in class org.xnio.conduits.AbstractSinkConduit<org.xnio.conduits.StreamSinkConduit>
java.io.IOException
protected boolean isWritesTerminated()
protected void queueCloseFrames()
protected void finished()
Copyright © 2018. All rights reserved.