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 OutputStreamThe 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 TypMethodeBeschreibungvoidclose()Closes this output stream and releases any system resources associated with the stream.voidflush()Flushes this output stream and forces any buffered output bytes to be written out to the stream.voidwrite(int b) Writes the specifiedbyteto 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, ornullif this instance is to be created without an underlying stream.
-
-
Methodendetails
-
getDelegate
-
write
Writes the specifiedbyteto this output stream.The
writemethod ofDelegatingOutputStreamcalls thewritemethod of its underlying output stream, that is, it performs out.write(b).Implements the abstract write method of OutputStream.
- Angegeben von:
writein 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
flushmethod ofDelegatingOutputStreamcalls theflushmethod of its underlying output stream.- Angegeben von:
flushin SchnittstelleFlushable- Setzt außer Kraft:
flushin 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
closemethod ofDelegatingOutputStreamcalls itsflushmethod, and then calls theclosemethod of its underlying output stream.- Angegeben von:
closein SchnittstelleAutoCloseable- Angegeben von:
closein SchnittstelleCloseable- Setzt außer Kraft:
closein KlasseOutputStream- Löst aus:
IOException- if an I/O error occurs.- Siehe auch:
-