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建立一個新適配器。

這裡提供一個 null 接收器來簡化使用適配器的程式碼是有效的,即這樣它就可以將其與 try-with-resources 一起使用,而無需檢查 null 接收器本身。

參數
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