类 PoolingByteArrayOutputStream

java.lang.Object
java.io.OutputStream
java.io.ByteArrayOutputStream
com.android.volley.toolbox.PoolingByteArrayOutputStream
所有已实现的接口:
Closeable, Flushable, AutoCloseable

public class PoolingByteArrayOutputStream extends ByteArrayOutputStream
A variation of ByteArrayOutputStream that uses a pool of byte[] buffers instead of always allocating them fresh, saving on heap churn.
  • 构造器详细资料

    • PoolingByteArrayOutputStream

      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.
    • PoolingByteArrayOutputStream

      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.
      参数:
      size - initial size for the underlying byte array. The value will be pinned to a default minimum size.
  • 方法详细资料