2 * Copyright (C) 2007 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.ddmlib;
20 * Classes which implement this interface provide methods that deal with out from a remote shell
21 * command on a device/emulator.
23 public interface IShellOutputReceiver {
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.
30 public void addOutput(byte[] data, int offset, int length);
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.
40 * Cancel method to stop the execution of the remote shell command.
41 * @return true to cancel the execution of the command.
43 public boolean isCancelled();