OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / sdk / ddms / libs / ddmlib / src / com / android / ddmlib / IShellOutputReceiver.java
1 /*
2  * Copyright (C) 2007 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package com.android.ddmlib;
18
19 /**
20  * Classes which implement this interface provide methods that deal with out from a remote shell
21  * command on a device/emulator.
22  */
23 public interface IShellOutputReceiver {
24     /**
25      * Called every time some new data is available.
26      * @param data The new data.
27      * @param offset The offset at which the new data starts.
28      * @param length The length of the new data.
29      */
30     public void addOutput(byte[] data, int offset, int length);
31
32     /**
33      * Called at the end of the process execution (unless the process was
34      * canceled). This allows the receiver to terminate and flush whatever
35      * data was not yet processed.
36      */
37     public void flush();
38
39     /**
40      * Cancel method to stop the execution of the remote shell command.
41      * @return true to cancel the execution of the command.
42      */
43     public boolean isCancelled();
44 };