public class StreamWriteFilter extends AbstractStreamWriteFilter<InputStream>
InputStream
objects directly using IoSession#write(Object). When an
InputStream is written to a session this filter will read the bytes
from the stream into IoBuffer objects and write those buffers
to the next filter. When end of stream has been reached this filter will
call IoFilter.NextFilter#messageSent(IoSession,WriteRequest) using the original
InputStream written to the session and notifies
WriteFuture on the
original WriteRequest.
This filter will ignore written messages which aren't InputStream
instances. Such messages will be passed to the next filter directly.
NOTE: this filter does not close the stream after all data from stream
has been written. The IoHandler should take
care of that in its
IoHandler.messageSent(IoSession,Object)
callback.
IoFilter.NextFilterCURRENT_STREAM, CURRENT_WRITE_REQUEST, DEFAULT_STREAM_BUFFER_SIZE, WRITE_REQUEST_QUEUE| Constructor and Description |
|---|
StreamWriteFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected Class<InputStream> |
getMessageClass() |
protected IoBuffer |
getNextBuffer(InputStream is) |
filterWrite, getWriteBufferSize, messageSent, onPreAdd, setWriteBufferSizedestroy, exceptionCaught, filterClose, init, messageReceived, onPostAdd, onPostRemove, onPreRemove, sessionClosed, sessionCreated, sessionIdle, sessionOpened, toStringprotected IoBuffer getNextBuffer(InputStream is) throws IOException
getNextBuffer in class AbstractStreamWriteFilter<InputStream>IOExceptionprotected Class<InputStream> getMessageClass()
getMessageClass in class AbstractStreamWriteFilter<InputStream>