public class PoolingByteArrayOutputStream extends ByteArrayOutputStream
ByteArrayOutputStream that uses a pool of byte[] buffers instead
of always allocating them fresh, saving on heap churn.buf, count| 构造器和说明 |
|---|
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 PoolingByteArrayOutputStream(ByteArrayPool pool)
public PoolingByteArrayOutputStream(ByteArrayPool pool, int size)
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.public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 ByteArrayOutputStreamIOExceptionpublic void write(byte[] buffer,
int offset,
int len)
write 在类中 ByteArrayOutputStreampublic void write(int oneByte)
write 在类中 ByteArrayOutputStreamCopyright © 2018. All rights reserved.