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