ShellOutputReceiverStream

public final class ShellOutputReceiverStream
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.ShellOutputReceiverStream


OutputStream 的公用程式子類別,會寫入 IShellOutputReceiver。

摘要

公用建構函式

ShellOutputReceiverStream(IShellOutputReceiver receiver)

為指定的 IShellOutputReceiver 建立新的轉接器。

ShellOutputReceiverStream(IShellOutputReceiver receiver, FileOutputStream fileOutput)

公用方法

void close()
void flush()
void write(byte[] b)
void write(byte[] b, int off, int len)
void write(int b)

公用建構函式

ShellOutputReceiverStream

public ShellOutputReceiverStream (IShellOutputReceiver receiver)

為指定的 IShellOutputReceiver 建立新的轉接器。

這裡提供空值接收器是有效的,可簡化使用配接器的程式碼,也就是說,這樣一來,配接器就能搭配 try-with-resources 使用,而不必自行檢查空值接收器。

參數
receiver IShellOutputReceiver

ShellOutputReceiverStream

public ShellOutputReceiverStream (IShellOutputReceiver receiver, 
                FileOutputStream fileOutput)

參數
receiver IShellOutputReceiver

fileOutput FileOutputStream

公用方法

關閉

public void close ()

清除

public void flush ()

寫出好文

public void write (byte[] b)

參數
b byte

寫出好文

public void write (byte[] b, 
                int off, 
                int len)

參數
b byte

off int

len int

寫出好文

public void write (int b)

參數
b int