CollectingOutputReceiver

public class CollectingOutputReceiver
extends Object implements IShellOutputReceiver

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


एक IShellOutputReceiver, जो पूरे शेल आउटपुट को एक String में इकट्ठा करता है.

खास जानकारी

सार्वजनिक कंस्ट्रक्टर

CollectingOutputReceiver()
CollectingOutputReceiver(CountDownLatch commandCompleteLatch)

पब्लिक मेथड

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

जब भी कोई नया डेटा उपलब्ध होता है, तब इसे कॉल किया जाता है.

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

आउटपुट कलेक्शन को रद्द करता है.

void flush()

प्रोसेस के पूरा होने पर कॉल किया जाता है. हालांकि, अगर प्रोसेस को रद्द कर दिया गया है, तो कॉल नहीं किया जाता.

String getOutput()
boolean isCancelled()

रिमोट शेल कमांड को लागू होने से रोकने के लिए, Cancel method का इस्तेमाल करें.

boolean isComplete()

सार्वजनिक कंस्ट्रक्टर

CollectingOutputReceiver

public CollectingOutputReceiver ()

CollectingOutputReceiver

public CollectingOutputReceiver (CountDownLatch commandCompleteLatch)

पैरामीटर
commandCompleteLatch CountDownLatch

पब्लिक मेथड

addOutput

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

जब भी कोई नया डेटा उपलब्ध होता है, तब इसे कॉल किया जाता है.

पैरामीटर
data byte: नया डेटा.

offset int: वह ऑफ़सेट जहां से नया डेटा शुरू होता है.

length int: नए डेटा की लंबाई.

awaitCompletion

public boolean awaitCompletion (long timeout, 
                TimeUnit unit)

पैरामीटर
timeout long

unit TimeUnit

रिटर्न
boolean

थ्रॉ
InterruptedException

अभी नहीं

public void cancel ()

आउटपुट कलेक्शन को रद्द करता है.

डेटा को उसकी जगह ले जाना

public void flush ()

प्रोसेस के पूरा होने पर कॉल किया जाता है. हालांकि, अगर प्रोसेस को रद्द कर दिया गया है, तो कॉल नहीं किया जाता. इससे, डेटा पाने वाले को उस डेटा को मिटाने और प्रोसेस न करने की अनुमति मिलती है जिसे अब तक प्रोसेस नहीं किया गया है.

getOutput

public String getOutput ()

रिटर्न
String

isCancelled

public boolean isCancelled ()

रिमोट शेल कमांड को लागू होने से रोकने के लिए, Cancel method का इस्तेमाल करें.

रिटर्न
boolean कमांड को लागू होने से रोकने के लिए, true.

isComplete

public boolean isComplete ()

रिटर्न
boolean