org.apache.cassandra.io.util
Class DataOutputBuffer

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.DataOutputStream
              extended by org.apache.cassandra.io.util.DataOutputBuffer
All Implemented Interfaces:
java.io.Closeable, java.io.DataOutput, java.io.Flushable

public final class DataOutputBuffer
extends java.io.DataOutputStream

An implementation of the DataOutputStream interface. This class is completely thread unsafe.


Field Summary
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
DataOutputBuffer()
           
DataOutputBuffer(int size)
           
 
Method Summary
 byte[] asByteArray()
           
 byte[] getData()
          Returns the current contents of the buffer.
 int getLength()
          Returns the length of the valid data currently in the buffer.
 DataOutputBuffer reset()
          Resets the buffer to empty.
 
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
 
Methods inherited from class java.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

DataOutputBuffer

public DataOutputBuffer()

DataOutputBuffer

public DataOutputBuffer(int size)
Method Detail

asByteArray

public byte[] asByteArray()
Returns:
The valid contents of the buffer, possibly by copying: only safe for one-time-use buffers.

getData

public byte[] getData()
Returns the current contents of the buffer. Data is only valid to getLength().


getLength

public int getLength()
Returns the length of the valid data currently in the buffer.


reset

public DataOutputBuffer reset()
Resets the buffer to empty.



Copyright © 2010 The Apache Software Foundation