org.xnio.conduits.Conduit, org.xnio.conduits.SinkConduit, org.xnio.conduits.StreamSinkConduitGzipStreamSinkConduitpublic class DeflatingStreamSinkConduit
extends java.lang.Object
implements org.xnio.conduits.StreamSinkConduit
| Modifier and Type | Field | Description |
|---|---|---|
protected PooledByteBuffer |
currentBuffer |
The streams buffer.
|
protected java.util.zip.Deflater |
deflater |
| Constructor | Description |
|---|---|
DeflatingStreamSinkConduit(ConduitFactory<org.xnio.conduits.StreamSinkConduit> conduitFactory,
HttpServerExchange exchange) |
|
DeflatingStreamSinkConduit(ConduitFactory<org.xnio.conduits.StreamSinkConduit> conduitFactory,
HttpServerExchange exchange,
int deflateLevel) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
awaitWritable() |
|
void |
awaitWritable(long time,
java.util.concurrent.TimeUnit timeUnit) |
|
boolean |
flush() |
|
protected byte[] |
getTrailer() |
called before the stream is finally flushed.
|
org.xnio.XnioWorker |
getWorker() |
|
org.xnio.XnioIoThread |
getWriteThread() |
|
boolean |
isWriteResumed() |
|
boolean |
isWriteShutdown() |
|
protected void |
preDeflate(byte[] data) |
|
void |
resumeWrites() |
|
void |
setWriteReadyHandler(org.xnio.conduits.WriteReadyHandler handler) |
|
void |
suspendWrites() |
|
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() |
|
void |
wakeupWrites() |
|
int |
write(java.nio.ByteBuffer src) |
|
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
|
int |
writeFinal(java.nio.ByteBuffer src) |
|
long |
writeFinal(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
protected final java.util.zip.Deflater deflater
protected PooledByteBuffer currentBuffer
public DeflatingStreamSinkConduit(ConduitFactory<org.xnio.conduits.StreamSinkConduit> conduitFactory, HttpServerExchange exchange)
public DeflatingStreamSinkConduit(ConduitFactory<org.xnio.conduits.StreamSinkConduit> conduitFactory, HttpServerExchange exchange, int deflateLevel)
public int write(java.nio.ByteBuffer src)
throws java.io.IOException
write in interface org.xnio.conduits.StreamSinkConduitjava.io.IOExceptionprotected void preDeflate(byte[] data)
public long write(java.nio.ByteBuffer[] srcs,
int offset,
int length)
throws java.io.IOException
write in interface org.xnio.conduits.StreamSinkConduitjava.io.IOExceptionpublic int writeFinal(java.nio.ByteBuffer src)
throws java.io.IOException
writeFinal in interface org.xnio.conduits.StreamSinkConduitjava.io.IOExceptionpublic long writeFinal(java.nio.ByteBuffer[] srcs,
int offset,
int length)
throws java.io.IOException
writeFinal in interface org.xnio.conduits.StreamSinkConduitjava.io.IOExceptionpublic long transferFrom(java.nio.channels.FileChannel src,
long position,
long count)
throws java.io.IOException
transferFrom in interface org.xnio.conduits.StreamSinkConduitjava.io.IOExceptionpublic long transferFrom(org.xnio.channels.StreamSourceChannel source,
long count,
java.nio.ByteBuffer throughBuffer)
throws java.io.IOException
transferFrom in interface org.xnio.conduits.StreamSinkConduitjava.io.IOExceptionpublic org.xnio.XnioWorker getWorker()
getWorker in interface org.xnio.conduits.Conduitpublic void suspendWrites()
suspendWrites in interface org.xnio.conduits.SinkConduitpublic boolean isWriteResumed()
isWriteResumed in interface org.xnio.conduits.SinkConduitpublic void wakeupWrites()
wakeupWrites in interface org.xnio.conduits.SinkConduitpublic void resumeWrites()
resumeWrites in interface org.xnio.conduits.SinkConduitpublic void terminateWrites()
throws java.io.IOException
terminateWrites in interface org.xnio.conduits.SinkConduitjava.io.IOExceptionpublic boolean isWriteShutdown()
isWriteShutdown in interface org.xnio.conduits.SinkConduitpublic void awaitWritable()
throws java.io.IOException
awaitWritable in interface org.xnio.conduits.SinkConduitjava.io.IOExceptionpublic void awaitWritable(long time,
java.util.concurrent.TimeUnit timeUnit)
throws java.io.IOException
awaitWritable in interface org.xnio.conduits.SinkConduitjava.io.IOExceptionpublic org.xnio.XnioIoThread getWriteThread()
getWriteThread in interface org.xnio.conduits.SinkConduitpublic void setWriteReadyHandler(org.xnio.conduits.WriteReadyHandler handler)
setWriteReadyHandler in interface org.xnio.conduits.SinkConduitpublic boolean flush()
throws java.io.IOException
flush in interface org.xnio.conduits.SinkConduitjava.io.IOExceptionprotected byte[] getTrailer()
public void truncateWrites()
throws java.io.IOException
truncateWrites in interface org.xnio.conduits.SinkConduitjava.io.IOExceptionCopyright © 2018. All rights reserved.