Package org.apache.lucene.tests.mockfile
Class FilterOutputStream2
java.lang.Object
java.io.OutputStream
org.apache.lucene.tests.mockfile.FilterOutputStream2
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
A
FilterOutputStream2
contains another OutputStream
, which it uses as its basic
source of data, possibly transforming the data along the way or providing additional
functionality.
Note: unlike FilterOutputStream
this class delegates every method by default. This
means to transform write
calls, you need to override multiple methods. On the other hand,
it is less trappy: a simple implementation that just overrides close
will not force bytes
to be written one-at-a-time.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final OutputStream
The underlyingOutputStream
instance. -
Constructor Summary
ConstructorDescriptionFilterOutputStream2
(OutputStream delegate) Construct aFilterOutputStream2
based on the specified base stream. -
Method Summary
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
delegate
The underlyingOutputStream
instance.
-
-
Constructor Details
-
FilterOutputStream2
Construct aFilterOutputStream2
based on the specified base stream.Note that base stream is closed if this stream is closed.
- Parameters:
delegate
- specified base stream.
-
-
Method Details
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-