Klasse DelegatingOutputStream
- Alle implementierten Schnittstellen:
Closeable
,Flushable
,AutoCloseable
- Bekannte direkte Unterklassen:
XOROutputStream
The class DelegatingOutputStream
itself simply overrides all methods of OutputStream
with
versions that pass all requests to the underlying output stream. Subclasses of DelegatingOutputStream
may further override some of these methods as well as provide additional methods and fields.
Note: The only difference to FilterOutputStream
is that DelegatingOutputStream
does not override OutputStream.write(byte[])
or OutputStream.write(byte[], int, int)
but rather exposes the original
implementations of InputStream
which call write(int)
instead of their delegate counterparts.
- Autor:
- Eike Stepper
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected OutputStream
The underlying output stream to be filtered. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungCreates an output stream filter built on top of the specified underlying output stream. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
close()
Closes this output stream and releases any system resources associated with the stream.void
flush()
Flushes this output stream and forces any buffered output bytes to be written out to the stream.void
write
(int b) Writes the specifiedbyte
to this output stream.Von Klasse geerbte Methoden java.io.OutputStream
nullOutputStream, write, write
-
Felddetails
-
out
The underlying output stream to be filtered.
-
-
Konstruktordetails
-
DelegatingOutputStream
Creates an output stream filter built on top of the specified underlying output stream.- Parameter:
out
- the underlying output stream to be assigned to the field this.out for later use, ornull
if this instance is to be created without an underlying stream.
-
-
Methodendetails
-
getDelegate
-
write
Writes the specifiedbyte
to this output stream.The
write
method ofDelegatingOutputStream
calls thewrite
method of its underlying output stream, that is, it performs out.write(b).Implements the abstract write method of OutputStream.
- Angegeben von:
write
in KlasseOutputStream
- Parameter:
b
- thebyte
.- Löst aus:
IOException
- if an I/O error occurs.
-
flush
Flushes this output stream and forces any buffered output bytes to be written out to the stream.The
flush
method ofDelegatingOutputStream
calls theflush
method of its underlying output stream.- Angegeben von:
flush
in SchnittstelleFlushable
- Setzt außer Kraft:
flush
in KlasseOutputStream
- Löst aus:
IOException
- if an I/O error occurs.- Siehe auch:
-
close
Closes this output stream and releases any system resources associated with the stream.The
close
method ofDelegatingOutputStream
calls itsflush
method, and then calls theclose
method of its underlying output stream.- Angegeben von:
close
in SchnittstelleAutoCloseable
- Angegeben von:
close
in SchnittstelleCloseable
- Setzt außer Kraft:
close
in KlasseOutputStream
- Löst aus:
IOException
- if an I/O error occurs.- Siehe auch:
-