大輸出接收器

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