org.littleshoot.util.mina
Class AbstractIoSessionOutputStream<T>

java.lang.Object
  extended by java.io.OutputStream
      extended by org.littleshoot.util.mina.AbstractIoSessionOutputStream<T>
Type Parameters:
T - The type of message it's an OutputStream for.
All Implemented Interfaces:
Closeable, Flushable
Direct Known Subclasses:
ByteBufferIoSessionOutputStream

public abstract class AbstractIoSessionOutputStream<T>
extends OutputStream

An abstract utility class for creating OutputStreams from MINA IoSessions for arbitrary message types. This allows users to create streams from specialized methods other than ByteBuffers.


Field Summary
protected  org.littleshoot.mina.common.IoSession m_ioSession
           
protected  org.littleshoot.mina.common.WriteFuture m_lastWriteFuture
           
 
Constructor Summary
protected AbstractIoSessionOutputStream(org.littleshoot.mina.common.IoSession session)
           
 
Method Summary
 void close()
           
 void flush()
           
protected  void write(T message)
           
 
Methods inherited from class java.io.OutputStream
write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_ioSession

protected final org.littleshoot.mina.common.IoSession m_ioSession

m_lastWriteFuture

protected org.littleshoot.mina.common.WriteFuture m_lastWriteFuture
Constructor Detail

AbstractIoSessionOutputStream

protected AbstractIoSessionOutputStream(org.littleshoot.mina.common.IoSession session)
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

write

protected void write(T message)
              throws IOException
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException


Copyright © 2013 LittleShoot. All Rights Reserved.