public class ProxyOutputStream extends OutputStream
FilterOutputStream
).
Note: This class is for internal use only and subject to backward incompatible change at any time.
Modifier and Type | Field and Description |
---|---|
protected OutputStream |
delegate |
Constructor and Description |
---|
ProxyOutputStream(OutputStream delegate)
Constructs a new ProxyOutputStream.
|
Modifier and Type | Method and Description |
---|---|
protected OutputStream |
assertStreamConnected()
Get the underlying OutputStream and assert it is connected.
|
void |
close()
Invokes the delegate's
close() method. |
void |
flush()
Invokes the delegate's
flush() method. |
protected void |
handleIOException(IOException e)
Handle any IOExceptions thrown.
|
void |
write(byte[] b)
Invokes the delegate's
write(byte[]) method. |
void |
write(byte[] b,
int off,
int len)
Invokes the delegate's
write(byte[]) method. |
void |
write(int b)
Invokes the delegate's
write(int) method. |
protected OutputStream delegate
public ProxyOutputStream(OutputStream delegate)
delegate
- the OutputStream to delegate topublic void write(int b) throws IOException
write(int)
method.write
in class OutputStream
b
- the byte to writeIOException
- if an I/O error occurspublic void write(byte[] b) throws IOException
write(byte[])
method.write
in class OutputStream
b
- the bytes to writeIOException
- if an I/O error occurspublic void write(byte[] b, int off, int len) throws IOException
write(byte[])
method.write
in class OutputStream
b
- the bytes to writeoff
- The start offsetlen
- The number of bytes to writeIOException
- if an I/O error occurspublic void flush() throws IOException
flush()
method.flush
in interface Flushable
flush
in class OutputStream
IOException
- if an I/O error occurspublic void close() throws IOException
close()
method.close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
- if an I/O error occursprotected void handleIOException(IOException e) throws IOException
This method provides a point to implement custom exception handling. The default behavior is to re-throw the exception.
e
- The IOException thrownIOException
- if an I/O error occursprotected OutputStream assertStreamConnected() throws IOException
IOException
- thrown when the stream is not connectedCopyright © 2013–2022. All rights reserved.