com.mckoi.database
Class CellBufferOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.ByteArrayOutputStream
          extended by com.mckoi.database.CellBufferOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public final class CellBufferOutputStream
extends java.io.ByteArrayOutputStream

This is a ByteArrayOutputStream that allows access to the underlying byte array. It can be instantiated, and then used over and over as a temporary buffer between the writeTo methods and the underlying random access file stream.

Author:
Tobias Downer

Field Summary
 
Fields inherited from class java.io.ByteArrayOutputStream
buf, count
 
Constructor Summary
CellBufferOutputStream(int length)
          The Constructor.
 
Method Summary
 byte[] getByteArray()
          Returns the underlying stream you should not use the stream while you have a handle on this reference.
 void seek(int pointer)
          Sets the pointer to specified point in the array.
 
Methods inherited from class java.io.ByteArrayOutputStream
close, reset, size, toByteArray, toString, toString, toString, write, write, writeTo
 
Methods inherited from class java.io.OutputStream
flush, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellBufferOutputStream

public CellBufferOutputStream(int length)
The Constructor.

Method Detail

getByteArray

public byte[] getByteArray()
Returns the underlying stream you should not use the stream while you have a handle on this reference.


seek

public void seek(int pointer)
Sets the pointer to specified point in the array.