MultiReceiver

public class MultiReceiver
extends Object implements IShellOutputReceiver

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


IShellOutputReceiver 的基本實作,可接收多個 IShellOutputReceiver 執行個體,並將收到的資料廣播至所有執行個體。

摘要

公用建構函式

MultiReceiver(IShellOutputReceiver... receivers)

公用方法

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

每當有新資料可用時,系統就會呼叫此方法。

void flush()

在程序執行結束時呼叫 (除非程序已取消)。

boolean isCancelled()

Cancel 方法可停止執行遠端 shell 命令。

公用建構函式

MultiReceiver

public MultiReceiver (IShellOutputReceiver... receivers)

參數
receivers IShellOutputReceiver

公用方法

addOutput

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

每當有新資料可用時,系統就會呼叫此方法。

參數
data byte:新資料。

offset int:新資料的起始位移。

length int:新資料的長度。

清除

public void flush ()

在程序執行結束時呼叫 (除非程序已取消)。這可讓接收端終止並清除尚未處理的資料。

isCancelled

public boolean isCancelled ()

取消方法,停止執行遠端 Shell 指令。

傳回
boolean true 可取消執行指令。