private class ProcessStream.InReader extends java.lang.Object implements ProcessStream.IOHelper
| Modifier and Type | Field and Description |
|---|---|
private java.io.Reader |
in
The reader from which to read.
|
| Constructor and Description |
|---|
InReader(java.io.InputStream in)
Construct an instance with the given stream as the source.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available()
The number of bytes available to be immediately read without
blocking.
|
void |
close()
Close and release any OS resources.
|
int |
read()
Read a character from the current read position in the stream.
|
void |
write(byte[] data)
Write the given byte array to the output destination.
|
void |
write(byte[] data,
int off,
int len)
Write the specified range of bytes from the given byte array to the output stream.
|
void |
write(java.lang.String data)
Write the given string to the output destination.
|
void |
writeCh(char ch)
Write the given character to the output destination.
|
InReader(java.io.InputStream in)
in - The stream source.public int available()
throws java.io.IOException
available in interface ProcessStream.IOHelperjava.io.IOExceptionpublic void writeCh(char ch)
writeCh in interface ProcessStream.IOHelperch - The character to be written.public void write(java.lang.String data)
write in interface ProcessStream.IOHelperdata - The data to be written.public void write(byte[] data)
write in interface ProcessStream.IOHelperdata - The data to be written.public void write(byte[] data,
int off,
int len)
throws java.io.IOException
write in interface ProcessStream.IOHelperdata - The data to be written.off - Starting offset in data from which to read bytes to be written. Must be
non-negative and < data.length.len - Length of data to be written. Must be non-negative and <=
(data.length - offset).java.io.IOException - If an I/O error occurs.public int read()
throws java.io.IOException
The underlying stream subclass determines the content of the result. Byte oriented streams such as pipes or files will return a byte while readers that generate keystrokes or characters may return a Unicode character.
read in interface ProcessStream.IOHelperjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface ProcessStream.IOHelperjava.io.IOException