Build 1.0_r1(from source)

android.webkit
Class ByteArrayBuilder

java.lang.Object
  extended by android.webkit.ByteArrayBuilder

 class ByteArrayBuilder
extends Object

Utility class optimized for accumulating bytes, and then spitting them back out. It does not optimize for returning the result in a single array, though this is supported in the API. It is fastest if the retrieval can be done via iterating through chunks. Things to add: - consider dynamically increasing our min_capacity, as we see mTotalSize increase


Nested Class Summary
static class ByteArrayBuilder.Chunk
           
 
Constructor Summary
ByteArrayBuilder()
           
ByteArrayBuilder(int minCapacity)
           
 
Method Summary
 void append(byte[] array)
           
 void append(byte[] array, int offset, int length)
           
 ByteArrayBuilder.Chunk getFirstChunk()
          The fastest way to retrieve the data is to iterate through the chunks.
 boolean isEmpty()
           
 void releaseChunk(ByteArrayBuilder.Chunk c)
          recycles chunk
 
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 minCapacity)
Method Detail

append

public void append(byte[] array)

append

public void append(byte[] array,
                   int offset,
                   int length)

getFirstChunk

public ByteArrayBuilder.Chunk getFirstChunk()
The fastest way to retrieve the data is to iterate through the chunks. This returns the first chunk. Note: this pulls the chunk out of the queue. The caller must call releaseChunk() to dispose of it.


releaseChunk

public void releaseChunk(ByteArrayBuilder.Chunk c)
recycles chunk


isEmpty

public boolean isEmpty()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature