FixedByteArrayOutputStream
public
class
FixedByteArrayOutputStream
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.util.FixedByteArrayOutputStream |
仅保留最大数据量的内存 ERROR(/OutputStream)。
这通过保持固定大小的循环字节数组来实现。
不具有线程安全性。
摘要
公共构造函数 | |
|---|---|
FixedByteArrayOutputStream(int maxDataSize)
|
|
公共方法 | |
|---|---|
InputStream
|
getData()
获取用于读取收集的输出的 InputStream。 |
long
|
size()
|
void
|
write(byte[] b, int off, int len)
|
void
|
write(int data)
|
公共构造函数
FixedByteArrayOutputStream
public FixedByteArrayOutputStream (int maxDataSize)
创建 FixedByteArrayOutputStream。
| 参数 | |
|---|---|
maxDataSize |
int:要在输出流中保留的大致最大大小(以字节为单位)
|
公共方法
getData
public InputStream getData ()
获取 InputStream 以读取收集的输出。
不具有线程安全性。假定在读取时不会写入任何数据
| 返回 | |
|---|---|
InputStream |
|
size
public long size ()
| 返回 | |
|---|---|
long |
当前存储的字节数。 |
写内容
public void write (byte[] b,
int off,
int len)| 参数 | |
|---|---|
b |
byte |
off |
int |
len |
int |
写内容
public void write (int data)
| 参数 | |
|---|---|
data |
int |