NullOutputReceiver

public final class NullOutputReceiver
extends Object implements IShellOutputReceiver

java.lang.Object
   ↳ com.android.ddmlib.NullOutputReceiver


不执行任何操作的 IShellOutputReceiver 实现。

当不需要输出时,此方法可用于执行远程 shell 命令。

摘要

公共构造函数

NullOutputReceiver()

公共方法

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

每次有新数据可用时调用。

void flush()

在进程执行结束时调用(除非进程被取消)。

static IShellOutputReceiver getReceiver()
boolean isCancelled()

用于停止执行远程 shell 命令的 Cancel 方法。

公共构造函数

NullOutputReceiver

public NullOutputReceiver ()

公共方法

addOutput

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

每次有新数据可用时调用。

参数
data byte:新数据。

offset int:新数据开始的偏移量。

length int:新数据的长度。

flush

public void flush ()

在进程执行结束时调用(除非进程被取消)。这样,接收器就可以终止并刷新尚未处理的所有数据。

getReceiver

public static IShellOutputReceiver getReceiver ()

返回
IShellOutputReceiver

isCancelled

public boolean isCancelled ()

用于停止执行远程 shell 命令的取消方法。

返回
boolean true,则取消执行命令。