org.androidpn.server.xmpp.net
Class IoBufferWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.androidpn.server.xmpp.net.IoBufferWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class IoBufferWriter
extends java.io.Writer

Wrapper on a MINA IoBuffer that extends the Writer class.

Author:
Sehwan Noh (devnoh@gmail.com)

Constructor Summary
IoBufferWriter(org.apache.mina.core.buffer.IoBuffer ioBuffer, java.nio.charset.CharsetEncoder encoder)
          Constructor.
 
Method Summary
 void close()
          Closes the stream, flushing it first.
 void flush()
          Flushes the stream.
 void write(char[] cbuf, int off, int len)
          Writes a portion of an array of characters.
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoBufferWriter

public IoBufferWriter(org.apache.mina.core.buffer.IoBuffer ioBuffer,
                      java.nio.charset.CharsetEncoder encoder)
Constructor.

Parameters:
ioBuffer - the IoBuffer
encoder - the charset encoder
Method Detail

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException
Writes a portion of an array of characters.

Specified by:
write in class java.io.Writer
Parameters:
cbuf - Array of characters
off - Offset from which to start writing characters
len - Number of characters to write
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flushes the stream.

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Closes the stream, flushing it first.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
Throws:
java.io.IOException