CollectingOutputReceiver

public class CollectingOutputReceiver
extends Object implements IShellOutputReceiver

java.lang.Object
   ↳ com.android.ddmlib.CollectingOutputReceiver


Một IShellOutputReceiver thu thập toàn bộ đầu ra của shell vào một String.

Tóm tắt

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

CollectingOutputReceiver()
CollectingOutputReceiver(CountDownLatch commandCompleteLatch)

Phương thức công khai

void addOutput(byte[] data, int offset, int length)

Được gọi mỗi khi có dữ liệu mới.

boolean awaitCompletion(long timeout, TimeUnit unit)
void cancel()

Huỷ bộ sưu tập đầu ra.

void flush()

Được gọi khi kết thúc quá trình thực thi (trừ phi quá trình bị huỷ).

String getOutput()
boolean isCancelled()

Phương thức huỷ để dừng thực thi lệnh shell từ xa.

boolean isComplete()

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

CollectingOutputReceiver

public CollectingOutputReceiver ()

CollectingOutputReceiver

public CollectingOutputReceiver (CountDownLatch commandCompleteLatch)

Tham số
commandCompleteLatch CountDownLatch

Phương thức công khai

addOutput

public void addOutput (byte[] data, 
                int offset, 
                int length)

Được gọi mỗi khi có dữ liệu mới.

Tham số
data byte: Dữ liệu mới.

offset int: Độ lệch tại vị trí bắt đầu của dữ liệu mới.

length int: Độ dài của dữ liệu mới.

awaitCompletion

public boolean awaitCompletion (long timeout, 
                TimeUnit unit)

Tham số
timeout long

unit TimeUnit

Giá trị trả về
boolean

hủy

public void cancel ()

Huỷ bộ sưu tập đầu ra.

flush

public void flush ()

Được gọi khi kết thúc quá trình thực thi (trừ phi quá trình bị huỷ). Điều này cho phép bộ nhận kết thúc và xoá mọi dữ liệu chưa được xử lý.

getOutput

public String getOutput ()

Giá trị trả về
String

isCancelled

public boolean isCancelled ()

Phương thức huỷ để dừng thực thi lệnh shell từ xa.

Giá trị trả về
boolean true để huỷ quá trình thực thi lệnh.

isComplete

public boolean isComplete ()

Giá trị trả về
boolean