org.codehaus.jackson.util
Class ByteArrayBuilder

java.lang.Object
  extended by org.codehaus.jackson.util.ByteArrayBuilder

public final class ByteArrayBuilder
extends Object

Helper class that is similar to ByteArrayOutputStream in usage, but more geared to Jackson use cases internally. Specific changes include segment storage (no need to have linear backing buffer, can avoid reallocs, copying), as well API not based on OutputStream. In short, a very much specialized builder object.


Constructor Summary
ByteArrayBuilder()
           
ByteArrayBuilder(int firstBlockSize)
           
 
Method Summary
 void append(int i)
           
 void appendThreeBytes(int b24)
           
 void appendTwoBytes(int b16)
           
 void reset()
           
 byte[] toByteArray()
          Method called when results are finalized and we can get the full aggregated result buffer to return to the caller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteArrayBuilder

public ByteArrayBuilder()

ByteArrayBuilder

public ByteArrayBuilder(int firstBlockSize)
Method Detail

reset

public void reset()

append

public void append(int i)

appendTwoBytes

public void appendTwoBytes(int b16)

appendThreeBytes

public void appendThreeBytes(int b24)

toByteArray

public byte[] toByteArray()
Method called when results are finalized and we can get the full aggregated result buffer to return to the caller