private class ProcessStream.OutStream extends java.lang.Object implements ProcessStream.IOHelper
Modifier and Type | Field and Description |
---|---|
private java.io.OutputStream |
out
The stream to which to write.
|
Constructor and Description |
---|
OutStream(java.io.OutputStream out)
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.
|
OutStream(java.io.OutputStream out)
out
- The stream source.public int available()
available
in interface ProcessStream.IOHelper
public void writeCh(char ch) throws java.io.IOException
writeCh
in interface ProcessStream.IOHelper
ch
- The character to be written.java.io.IOException
public void write(java.lang.String data) throws java.io.IOException
write
in interface ProcessStream.IOHelper
data
- The data to be written.java.io.IOException
public void write(byte[] data) throws java.io.IOException
write
in interface ProcessStream.IOHelper
data
- The data to be written.java.io.IOException
public void write(byte[] data, int off, int len) throws java.io.IOException
write
in interface ProcessStream.IOHelper
data
- 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()
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.IOHelper
public void close() throws java.io.IOException
close
in interface ProcessStream.IOHelper
java.io.IOException