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
synchronized void addOutput(byte[] data, int offset, int length)
synchronized void cancel()
Cancels the command.
synchronized void clear()
Delete currently accumulated data, and then re-create a new file.
void delete()
Delete all accumulated data.
synchronized void flush()
synchronized InputStreamSource getData()
Gets the collected output as a InputStreamSource.
synchronized InputStreamSource getData(int maxBytes)
Gets the last maxBytes of collected output as a InputStreamSource.
synchronized 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)

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

Public Methods

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

public synchronized void cancel ()

Cancels the command.

public synchronized void clear ()

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

public void delete ()

Delete all accumulated data.

public synchronized void flush ()

public synchronized InputStreamSource getData ()

Gets the collected output as a InputStreamSource.

Returns
  • The collected output from the command.

public synchronized InputStreamSource getData (int maxBytes)

Gets the last maxBytes of collected output as a InputStreamSource.

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

public synchronized boolean isCancelled ()