to top
public class

LargeOutputReceiver

extends Object
implements IShellOutputReceiver
java.lang.Object
   ↳ com.android.tradefed.device.LargeOutputReceiver

Class Overview

A class designed to help run long running commands collect output.

The maximum size of the tmp file is limited to approximately maxFileSize. To prevent data loss when the limit has been reached, this file keeps set of tmp host files.

Summary

Public Constructors
LargeOutputReceiver(String descriptor, String serialNumber, long maxDataSize)
Public Methods
void addOutput(byte[] data, int offset, int length)
void cancel()
Cancels the command.
void clear()
Delete currently accumulated data, and then re-create a new file.
void delete()
Delete all accumulated data.
void flush()
InputStreamSource getData()
Gets the collected output as a InputStreamSource.
InputStreamSource getData(int maxBytes)
Gets the last maxBytes of collected output as a InputStreamSource.
boolean isCancelled()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.ddmlib.IShellOutputReceiver

Public Constructors

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

Creates a LargeOutputReceiver.

Parameters
descriptor String: the descriptor of the command to run. For logging only.
serialNumber String: the serial number of the device. For logging only.
maxDataSize long: the approximate max amount of data to keep.

Public Methods

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

Parameters
data byte
offset int
length int

public void cancel ()

Cancels the command.

public void clear ()

Delete currently accumulated data, and then re-create a new file.

public void delete ()

Delete all accumulated data.

public void flush ()

public InputStreamSource getData ()

Gets the collected output as a InputStreamSource.

Returns
InputStreamSource The collected output from the command.

public InputStreamSource getData (int maxBytes)

Gets the last maxBytes of collected output as a InputStreamSource.

Parameters
maxBytes int: the maximum amount of data to return. Should be an amount that can comfortably fit in memory
Returns
InputStreamSource The collected output from the command, stored in memory

public boolean isCancelled ()

Returns
boolean