LargeOutputReceiver
public
class
LargeOutputReceiver
extends Object
implements
IShellOutputReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.LargeOutputReceiver |
這個類別旨在協助執行長時間執行的指令收集輸出內容。
tmp 檔案的大小上限約為 maxFileSize
。為避免達到限制時資料遺失,這個檔案會保留一組暫存主機檔案。
摘要
公用建構函式 | |
---|---|
LargeOutputReceiver(String descriptor, String serialNumber, long maxDataSize)
|
公用方法 | |
---|---|
void
|
addOutput(byte[] data, int offset, int length)
|
void
|
cancel()
取消指令。 |
void
|
clear()
刪除目前累積的資料,然後重新建立新檔案。 |
void
|
delete()
刪除所有累積資料。 |
void
|
flush()
|
InputStreamSource
|
getData()
以 |
InputStreamSource
|
getData(int maxBytes)
取得收集的輸出內容的最後一個 maxBytes,做為 |
InputStreamSource
|
getData(int maxBytes, int offset)
取得收集的輸出內容的最後一個 maxBytes,做為 |
boolean
|
isCancelled()
|
公用建構函式
LargeOutputReceiver
public LargeOutputReceiver (String descriptor, String serialNumber, long maxDataSize)
參數 | |
---|---|
descriptor |
String :要執行的指令描述項。僅供記錄。 |
serialNumber |
String :裝置的序號。僅供記錄。 |
maxDataSize |
long :大約要保留的資料量。 |
公用方法
addOutput
public void addOutput (byte[] data, int offset, int length)
參數 | |
---|---|
data |
byte |
offset |
int |
length |
int |
cancel
public void cancel ()
取消指令。
清除
public void clear ()
刪除目前累積的資料,然後重新建立新檔案。
刪除
public void delete ()
刪除所有累積資料。
排空
public void flush ()
getData
public InputStreamSource getData ()
以 InputStreamSource
的形式取得收集到的輸出內容。
傳回 | |
---|---|
InputStreamSource |
收集的指令輸出內容。 |
getData
public InputStreamSource getData (int maxBytes)
取得收集到的輸出內容的最後一個 maxBytes,做為 InputStreamSource
。
參數 | |
---|---|
maxBytes |
int :傳回的資料數量上限。應為可輕鬆放入記憶體的數量 |
傳回 | |
---|---|
InputStreamSource |
指令收集的輸出內容,已儲存在記憶體中 |
getData
public InputStreamSource getData (int maxBytes, int offset)
取得收集到的輸出內容的最後一個 maxBytes,做為 InputStreamSource
。
參數 | |
---|---|
maxBytes |
int :傳回的資料數量上限。應為可輕鬆放入記憶體的數量 |
offset |
int :從緩衝區開始擷取資料的偏移量。 |
傳回 | |
---|---|
InputStreamSource |
指令收集的輸出內容,已儲存在記憶體中 |
isCancelled
public boolean isCancelled ()
傳回 | |
---|---|
boolean |