大型輸出接收器
public class LargeOutputReceiver
extends Object
implements IShellOutputReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.LargeOutputReceiver |
旨在幫助運行長時間運行的命令的類收集輸出。
tmp文件的最大大小限制為大約maxFileSize
。為防止在達到限制時丟失數據,此文件保留tmp主機文件集。
概要
公共建設者 | |
---|---|
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 ()
|
公共建設者
大型輸出接收器
public LargeOutputReceiver (String descriptor, String serialNumber, long maxDataSize)
創建一個LargeOutputReceiver
。
參量 | |
---|---|
descriptor | String :要運行的命令的描述符。僅用於記錄。 |
serialNumber | String :設備的序列號。僅用於記錄。 |
maxDataSize | long :要保留的近似最大數據量。 |
公開方法
addOutput
public void addOutput (byte[] data, int offset, int length)
參量 | |
---|---|
data | byte |
offset | int |
length | int |
取消
public void cancel ()
取消命令。
明確
public void clear ()
刪除當前累積的數據,然後重新創建一個新文件。
刪除
public void delete ()
刪除所有累積的數據。
齊平
public void flush ()
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 | 命令收集的輸出,存儲在內存中 |
取消
public boolean isCancelled ()
退貨 | |
---|---|
boolean |