public class WrapperOutputStream extends OutputStream implements OutputStreaming
| Modifier and Type | Field and Description |
|---|---|
protected OutputStream |
m_out
The underlying OutputStream object to use.
|
| Constructor and Description |
|---|
WrapperOutputStream()
Construct an uninitialized WrapperOutputStream.
|
WrapperOutputStream(OutputStream out)
Construct a WrapperOutputStream that will output to the specified OutputStream object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this OutputStream and releases any associated system resources.
|
protected OutputStream |
ensureOutputStream()
Return the underlying OutputStream.
|
void |
flush()
Flushes this OutputStream and forces any buffered output bytes to be written.
|
OutputStream |
getOutputStream()
Obtain the underlying OutputStream.
|
void |
setOutputStream(OutputStream out)
Specify the underlying OutputStream.
|
void |
write(byte[] ab)
Writes all the bytes in the array
ab. |
void |
write(byte[] ab, int of, int cb)
Writes
cb bytes starting at offset of from the array ab. |
void |
write(int b)
Writes the eight low-order bits of the argument
b. |
protected OutputStream m_out
public WrapperOutputStream()
public WrapperOutputStream(OutputStream out)
out - an OutputStream object to write topublic OutputStream getOutputStream()
protected OutputStream ensureOutputStream()
IllegalStateException - if the underlying stream has not been specified.public void setOutputStream(OutputStream out)
out - the stream to be wrappedIllegalStateException - if the underlying stream has already been specified.
public void write(int b)
throws IOException
b. The 24 high-order bits of b are ignored.write in interface com.oracle.common.io.OutputStreamingwrite in class OutputStreamb - the byte to write (passed as an integer)IOException - if an I/O error occurs
public void write(byte[] ab)
throws IOException
ab.write in interface com.oracle.common.io.OutputStreamingwrite in class OutputStreamab - the byte array to writeIOException - if an I/O error occursNullPointerException - if ab is null
public void write(byte[] ab,
int of,
int cb)
throws IOException
cb bytes starting at offset of from the array ab.write in interface com.oracle.common.io.OutputStreamingwrite in class OutputStreamab - the byte array to write fromof - the offset into ab to start writing fromcb - the number of bytes from ab to writeIOException - if an I/O error occursNullPointerException - if ab is nullIndexOutOfBoundsException - if of is negative, or cb is negative, or of+cb is greater than ab.length
public void flush()
throws IOException
flush in interface com.oracle.common.io.OutputStreamingflush in interface Flushableflush in class OutputStreamIOException - if an I/O error occurs
public void close()
throws IOException
close in interface com.oracle.common.io.OutputStreamingclose in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOException - if an I/O error occurs