Package org.apache.cxf.io
Class AbstractThresholdOutputStream
java.lang.Object
java.io.OutputStream
org.apache.cxf.io.AbstractWrappedOutputStream
org.apache.cxf.io.AbstractThresholdOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Outputstream that will buffer a certain amount before writing anything to the underlying
stream. When the threshold is reached, provides a callback point to allow the
subclass to update headers, replace/set the output stream, etc...
Also provides a callback for when the stream is closed without it reaching the threshold.
-
Field Summary
Fields inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
allowFlush, wrappedStream, written
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.cxf.io.AbstractWrappedOutputStream
allowFlush, flush, onFirstWrite, write
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
threshold
protected int threshold -
buffer
-
-
Constructor Details
-
AbstractThresholdOutputStream
public AbstractThresholdOutputStream(int threshold)
-
-
Method Details
-
thresholdReached
- Throws:
IOException
-
thresholdNotReached
- Throws:
IOException
-
write
- Overrides:
write
in classAbstractWrappedOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classAbstractWrappedOutputStream
- Throws:
IOException
-
unBuffer
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classAbstractWrappedOutputStream
- Throws:
IOException
-