ShellOutputReceiverStream

public final class ShellOutputReceiverStream
extends OutputStream

java.lang.Object
   ↳ java.io.OutputStream
     ↳ 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 ()

擲回
IOException

flush

public void flush ()

擲回
IOException

寫入

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