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 |