Class StdoutReader
java.lang.Object
hudson.plugins.android_emulator.util.StdoutReader
Reads to contents of an InputStream in an background thread,
useful to retrieve OutputStream/ErrorStream of a Process, and
allows retrieval as String representing a line of the output.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StdoutReader
createAndRunAsyncReader
(InputStream inputStream) Creates a new StdoutReader starting to read the data immediately of the given InputStream in an own thread.Retrieve the whole content currently buffered, empty lines are suppressed.readLine()
Retrieve the next line from the bufered InputStream.
-
Method Details
-
createAndRunAsyncReader
Creates a new StdoutReader starting to read the data immediately of the given InputStream in an own thread.- Parameters:
inputStream
- InputStream to read the data from- Returns:
- a reader for the given input stream
-
readLine
Retrieve the next line from the bufered InputStream.- Returns:
- next line of InputStream, if no new data is available empty or null if InputStream is closed.
-
readContent
Retrieve the whole content currently buffered, empty lines are suppressed.- Returns:
- all read lines, if no new data is available empty or null if InputStream is closed.
-