|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.thrift.transport.AutoExpandingBuffer
public class AutoExpandingBuffer
Helper class that wraps a byte[] so that it can expand and be reused. Users should call resizeIfNecessary to make sure the buffer has suitable capacity, and then use the array as needed. Note that the internal array will grow at a rate slightly faster than the requested capacity with the (untested) objective of avoiding expensive buffer allocations and copies.
Constructor Summary | |
---|---|
AutoExpandingBuffer(int initialCapacity,
double growthCoefficient)
|
Method Summary | |
---|---|
byte[] |
array()
|
void |
resizeIfNecessary(int size)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AutoExpandingBuffer(int initialCapacity, double growthCoefficient)
Method Detail |
---|
public void resizeIfNecessary(int size)
public byte[] array()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |