大型輸出接收器

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)

創建一個LargeOutputReceiver

公共方法

void addOutput (byte[] data, int offset, int length)

void cancel ()

取消命令。

void clear ()

刪除目前累積的數據,然後重新建立新檔案。

void delete ()

刪除所有累積資料。

void flush ()

InputStreamSource getData ()

取得作為InputStreamSource收集的輸出。

InputStreamSource getData (int maxBytes)

取得收集的輸出的最後maxBytes作為InputStreamSource

InputStreamSource getData (int maxBytes, int offset)

取得收集的輸出的最後maxBytes作為InputStreamSource

boolean isCancelled ()

公共構造函數

大型輸出接收器

public LargeOutputReceiver (String descriptor, 
                String serialNumber, 
                long maxDataSize)

創建一個LargeOutputReceiver

參數
descriptor String :要執行的命令的描述符。僅用於記錄。

serialNumber String :裝置的序號。僅用於記錄。

maxDataSize long :要保留的大約最大資料量。

公共方法

新增輸出

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 ()

取得數據

public InputStreamSource getData ()

取得作為InputStreamSource收集的輸出。

退貨
InputStreamSource從命令收集的輸出。

取得數據

public InputStreamSource getData (int maxBytes)

取得收集的輸出的最後maxBytes作為InputStreamSource

參數
maxBytes int :要傳回的最大資料量。應該是一個可以輕鬆放入記憶體的數量

退貨
InputStreamSource從命令收集的輸出,儲存在記憶體中

取得數據

public InputStreamSource getData (int maxBytes, 
                int offset)

取得收集的輸出的最後maxBytes作為InputStreamSource

參數
maxBytes int :要傳回的最大資料量。應該是一個可以輕鬆放入記憶體的數量

offset int :開始從緩衝區取得資料的偏移量。

退貨
InputStreamSource從命令收集的輸出,儲存在記憶體中

取消

public boolean isCancelled ()

退貨
boolean