Debian Codegraph @

common/src/main/java/com/android/utils/IReaderLogger.java

raw
1 /*
2 * Copyright (C) 2013 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.utils;
18
19 import com.android.annotations.NonNull;
20
21 import java.io.IOException;
22
23 /**
24 * <p>
25 * Interface to read a line from the {@link System#in} input stream.
26 * </p>
27 * The interface also implements {@link ILogger} since code that needs to ask for
28 * a command-line input will most likely also want to use {@link ILogger#info(String, Object...)}
29 * to print information such as an input prompt.
30 */
31 public interface IReaderLogger extends ILogger {
32
33 /**
34 * <p>
35 * Reads a line from {@link System#in}.
36 * </p>
37 * This call is blocking and should only be called from command-line enabled applications.
38 *
39 * @param inputBuffer A non-null buffer where to place the input.
40 * @return The number of bytes read into the buffer.
41 * @throws IOException as returned by {code System.in.read()}.
42 */
43 int readLine(@NonNull byte[] inputBuffer) throws IOException;
44 }