AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | Private 成员函数 | Private 属性 | 静态 Private 属性 | 所有成员列表
com.ab.network.toolbox.PoolingByteArrayOutputStream类 参考
类 com.ab.network.toolbox.PoolingByteArrayOutputStream 继承关系图:

Public 成员函数

 PoolingByteArrayOutputStream (ByteArrayPool pool)
 
 PoolingByteArrayOutputStream (ByteArrayPool pool, int size)
 
void close () throws IOException
 
void finalize ()
 
synchronized void write (byte[] buffer, int offset, int len)
 
synchronized void write (int oneByte)
 

Private 成员函数

void expand (int i)
 

Private 属性

final ByteArrayPool mPool
 

静态 Private 属性

static final int DEFAULT_SIZE = 256
 

详细描述

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

ByteArrayOutputStream

with a default size of

size

bytes. If more than

size

bytes are written to this instance, the underlying byte array will expand.

参数
sizeinitial 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

If the PoolingByteArrayOutputStream(ByteArrayPool) constructor is called, this is the default size to which the underlying byte array is initialized.

final ByteArrayPool com.ab.network.toolbox.PoolingByteArrayOutputStream.mPool
private

该类的文档由以下文件生成: