ShellOutputReceiverStream

public final class ShellOutputReceiverStream
extends OutputStream

java.lang.Object
java.io.OutputStream
  com.android.tradefed.util.ShellOutputReceiverStream


Lớp con tiện ích của OutputStream ghi vào IShellOutputReceiver.

Tóm tắt

Hàm khởi tạo công khai

ShellOutputReceiverStream(IShellOutputReceiver receiver)

Tạo trình chuyển đổi mới cho IShellOutputReceiver đã cho.

ShellOutputReceiverStream(IShellOutputReceiver receiver, FileOutputStream fileOutput)

Phương thức công khai

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

Hàm khởi tạo công khai

ShellOutputReceiverStream

public ShellOutputReceiverStream (IShellOutputReceiver receiver)

Tạo trình chuyển đổi mới cho IShellOutputReceiver đã cho.

Bạn có thể cung cấp một trình nhận rỗng tại đây để đơn giản hoá mã bằng cách sử dụng trình chuyển đổi, tức là để trình chuyển đổi có thể sử dụng mã này với try-with-resources mà không cần tự kiểm tra trình nhận rỗng.

Tham số
receiver IShellOutputReceiver

ShellOutputReceiverStream

public ShellOutputReceiverStream (IShellOutputReceiver receiver, 
                FileOutputStream fileOutput)

Tham số
receiver IShellOutputReceiver

fileOutput FileOutputStream

Phương thức công khai

đóng

public void close ()

Gửi
IOException

xả dữ liệu

public void flush ()

Gửi
IOException

write

public void write (byte[] b)

Tham số
b byte

write

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

Tham số
b byte

off int

len int

write

public void write (int b)

Tham số
b int