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
 
 public abstract class AbstractThresholdOutputStream extends AbstractWrappedOutputStream 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 SummaryFields Modifier and Type Field Description protected LoadingByteArrayOutputStreambufferprotected intthreshold- 
Fields inherited from class org.apache.cxf.io.AbstractWrappedOutputStreamallowFlush, wrappedStream, written
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractThresholdOutputStream(int threshold)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()abstract voidthresholdNotReached()abstract voidthresholdReached()voidunBuffer()voidwrite(byte[] b, int off, int len)voidwrite(int b)- 
Methods inherited from class org.apache.cxf.io.AbstractWrappedOutputStreamallowFlush, flush, onFirstWrite, write
 - 
Methods inherited from class java.io.OutputStreamnullOutputStream
 
- 
 
- 
- 
- 
Field Detail- 
thresholdprotected int threshold 
 - 
bufferprotected LoadingByteArrayOutputStream buffer 
 
- 
 - 
Method Detail- 
thresholdReachedpublic abstract void thresholdReached() throws IOException- Throws:
- IOException
 
 - 
thresholdNotReachedpublic abstract void thresholdNotReached() throws IOException- Throws:
- IOException
 
 - 
writepublic void write(byte[] b, int off, int len) throws IOException- Overrides:
- writein class- AbstractWrappedOutputStream
- Throws:
- IOException
 
 - 
writepublic void write(int b) throws IOException- Overrides:
- writein class- AbstractWrappedOutputStream
- Throws:
- IOException
 
 - 
unBufferpublic void unBuffer() throws IOException- Throws:
- IOException
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- AbstractWrappedOutputStream
- Throws:
- IOException
 
 
- 
 
-