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