android.webkit
Class ByteArrayBuilder
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteArrayBuilder
public ByteArrayBuilder()
ByteArrayBuilder
public ByteArrayBuilder(int minCapacity)
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()
Please submit a feedback, bug or feature