CollectingOutputReceiver

public class CollectingOutputReceiver
extends Object implements IShellOutputReceiver

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


IShellOutputReceiver thu thập toàn bộ kết quả 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ỷ tập hợp đầu ra.

void flush()

Được gọi khi kết thúc quá trình thực thi (trừ phi quá trình này 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: Điểm 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

Gửi
InterruptedException

hủy

public void cancel ()

Huỷ tập hợp đầu ra.

xả dữ liệu

public void flush ()

Được gọi khi kết thúc quá trình thực thi (trừ phi quá trình này bị huỷ). Điều này cho phép trình nhận chấm dứt 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