public class ProcessInputStream extends InputStream
CommandBuilder.popen()| Constructor and Description |
|---|
ProcessInputStream(Process p) |
| Modifier and Type | Method and Description |
|---|---|
String |
asText()
Reads the whole thing as a string.
|
int |
available() |
void |
close() |
InputStream |
getInputStream() |
Process |
getProcess()
Gives underlying
Process |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
long |
skip(long n) |
String |
verifyOrDieWith(String errorMessage)
Waits for the process to complete.
|
int |
waitFor()
Waits for the process to exit and returns its status code.
|
InputStream |
withErrorCheck()
Decorates the input stream by forcing an read error in case the process exits with
non-zero exit code.
|
mark, markSupported, resetpublic ProcessInputStream(Process p)
public int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic InputStream getInputStream()
public long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic int waitFor()
throws InterruptedException
InterruptedExceptionpublic String asText() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic String verifyOrDieWith(String errorMessage) throws IOException, InterruptedException
IOException with all the output from the process for diagnosis.IOExceptionInterruptedExceptionpublic InputStream withErrorCheck()
Copyright © 2004-2014. All Rights Reserved.