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)
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 ()
現在蓄積されているデータを削除してから、新しいファイルを再作成します。
delete
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 |