org.msgpack.io
Class LinkedBufferOutput

java.lang.Object
  extended by org.msgpack.io.LinkedBufferOutput
All Implemented Interfaces:
Closeable, Flushable, Output

public final class LinkedBufferOutput
extends Object


Field Summary
protected  byte[] buffer
           
protected  int bufferSize
           
protected  ByteBuffer castByteBuffer
           
protected  int filled
           
 
Constructor Summary
LinkedBufferOutput(int bufferSize)
           
 
Method Summary
 void clear()
           
 void close()
           
 void flush()
           
protected  boolean flushBuffer(byte[] b, int off, int len)
           
protected  void flushByteBuffer(ByteBuffer bb)
           
 int getSize()
           
 byte[] toByteArray()
           
 void write(byte[] b, int off, int len)
           
 void write(ByteBuffer bb)
           
 void writeByte(byte v)
           
 void writeByteAndByte(byte b, byte v)
           
 void writeByteAndDouble(byte b, double v)
           
 void writeByteAndFloat(byte b, float v)
           
 void writeByteAndInt(byte b, int v)
           
 void writeByteAndLong(byte b, long v)
           
 void writeByteAndShort(byte b, short v)
           
 void writeDouble(double v)
           
 void writeFloat(float v)
           
 void writeInt(int v)
           
 void writeLong(long v)
           
 void writeShort(short v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

protected byte[] buffer

filled

protected int filled

bufferSize

protected final int bufferSize

castByteBuffer

protected ByteBuffer castByteBuffer
Constructor Detail

LinkedBufferOutput

public LinkedBufferOutput(int bufferSize)
Method Detail

toByteArray

public byte[] toByteArray()

getSize

public int getSize()

flushBuffer

protected boolean flushBuffer(byte[] b,
                              int off,
                              int len)

clear

public void clear()

close

public void close()

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Specified by:
write in interface Output
Throws:
IOException

write

public void write(ByteBuffer bb)
           throws IOException
Specified by:
write in interface Output
Throws:
IOException

writeByte

public void writeByte(byte v)
               throws IOException
Specified by:
writeByte in interface Output
Throws:
IOException

writeShort

public void writeShort(short v)
                throws IOException
Specified by:
writeShort in interface Output
Throws:
IOException

writeInt

public void writeInt(int v)
              throws IOException
Specified by:
writeInt in interface Output
Throws:
IOException

writeLong

public void writeLong(long v)
               throws IOException
Specified by:
writeLong in interface Output
Throws:
IOException

writeFloat

public void writeFloat(float v)
                throws IOException
Specified by:
writeFloat in interface Output
Throws:
IOException

writeDouble

public void writeDouble(double v)
                 throws IOException
Specified by:
writeDouble in interface Output
Throws:
IOException

writeByteAndByte

public void writeByteAndByte(byte b,
                             byte v)
                      throws IOException
Specified by:
writeByteAndByte in interface Output
Throws:
IOException

writeByteAndShort

public void writeByteAndShort(byte b,
                              short v)
                       throws IOException
Specified by:
writeByteAndShort in interface Output
Throws:
IOException

writeByteAndInt

public void writeByteAndInt(byte b,
                            int v)
                     throws IOException
Specified by:
writeByteAndInt in interface Output
Throws:
IOException

writeByteAndLong

public void writeByteAndLong(byte b,
                             long v)
                      throws IOException
Specified by:
writeByteAndLong in interface Output
Throws:
IOException

writeByteAndFloat

public void writeByteAndFloat(byte b,
                              float v)
                       throws IOException
Specified by:
writeByteAndFloat in interface Output
Throws:
IOException

writeByteAndDouble

public void writeByteAndDouble(byte b,
                               double v)
                        throws IOException
Specified by:
writeByteAndDouble in interface Output
Throws:
IOException

flush

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

flushByteBuffer

protected void flushByteBuffer(ByteBuffer bb)
                        throws IOException
Throws:
IOException


Copyright © 2011. All Rights Reserved.