A variation of java.io.ByteArrayOutputStream that uses a pool of byte[] buffers instead of always allocating them fresh, saving on heap churn.
| com.ab.network.toolbox.PoolingByteArrayOutputStream.PoolingByteArrayOutputStream |
( |
ByteArrayPool |
pool | ) |
|
|
inline |
Constructs a new PoolingByteArrayOutputStream with a default size. If more bytes are written to this instance, the underlying byte array will expand.
| com.ab.network.toolbox.PoolingByteArrayOutputStream.PoolingByteArrayOutputStream |
( |
ByteArrayPool |
pool, |
|
|
int |
size |
|
) |
| |
|
inline |
Constructs a new
with a default size of
bytes. If more than
bytes are written to this instance, the underlying byte array will expand.
- 参数
-
| size | initial size for the underlying byte array. The value will be pinned to a default minimum size. |
| void com.ab.network.toolbox.PoolingByteArrayOutputStream.close |
( |
| ) |
throws IOException |
|
inline |
| void com.ab.network.toolbox.PoolingByteArrayOutputStream.expand |
( |
int |
i | ) |
|
|
inlineprivate |
Ensures there is enough space in the buffer for the given number of additional bytes.
| void com.ab.network.toolbox.PoolingByteArrayOutputStream.finalize |
( |
| ) |
|
|
inline |
| synchronized void com.ab.network.toolbox.PoolingByteArrayOutputStream.write |
( |
byte[] |
buffer, |
|
|
int |
offset, |
|
|
int |
len |
|
) |
| |
|
inline |
| synchronized void com.ab.network.toolbox.PoolingByteArrayOutputStream.write |
( |
int |
oneByte | ) |
|
|
inline |
| final int com.ab.network.toolbox.PoolingByteArrayOutputStream.DEFAULT_SIZE = 256 |
|
staticprivate |
| final ByteArrayPool com.ab.network.toolbox.PoolingByteArrayOutputStream.mPool |
|
private |
该类的文档由以下文件生成: