java.lang.Object | |||
↳ | java.io.OutputStream | ||
↳ | java.io.ByteArrayOutputStream | ||
↳ | com.android.volley.toolbox.PoolingByteArrayOutputStream |
A variation of java.io.ByteArrayOutputStream that uses a pool of byte[] buffers instead of always allocating them fresh, saving on heap churn.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.ByteArrayOutputStream
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PoolingByteArrayOutputStream(ByteArrayPool pool)
Constructs a new PoolingByteArrayOutputStream with a default size.
| |||||||||||
PoolingByteArrayOutputStream(ByteArrayPool pool, int size)
Constructs a new
ByteArrayOutputStream with a default size of size bytes. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | close() | ||||||||||
void | finalize() | ||||||||||
synchronized void | write(byte[] buffer, int offset, int len) | ||||||||||
synchronized void | write(int oneByte) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.io.ByteArrayOutputStream
| |||||||||||
From class
java.io.OutputStream
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.io.Closeable
| |||||||||||
From interface
java.io.Flushable
| |||||||||||
From interface
java.lang.AutoCloseable
|
Constructs a new PoolingByteArrayOutputStream with a default size. If more bytes are written to this instance, the underlying byte array will expand.
Constructs a new ByteArrayOutputStream
with a default size of size
bytes. If
more than size
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. |
---|
IOException |
---|