public class

PoolingByteArrayOutputStream

extends ByteArrayOutputStream
java.lang.Object
   ↳ java.io.OutputStream
     ↳ java.io.ByteArrayOutputStream
       ↳ com.android.volley.toolbox.PoolingByteArrayOutputStream

Class Overview

A variation of java.io.ByteArrayOutputStream that uses a pool of byte[] buffers instead of always allocating them fresh, saving on heap churn.

Summary

[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

Public Constructors

public PoolingByteArrayOutputStream (ByteArrayPool pool)

Constructs a new PoolingByteArrayOutputStream with a default size. If more bytes are written to this instance, the underlying byte array will expand.

public PoolingByteArrayOutputStream (ByteArrayPool pool, int size)

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.

Parameters
size initial size for the underlying byte array. The value will be pinned to a default minimum size.

Public Methods

public void close ()

Throws
IOException

public void finalize ()

public synchronized void write (byte[] buffer, int offset, int len)

public synchronized void write (int oneByte)