Package org.apache.cxf.io
Class CachedOutputStream
java.lang.Object
java.io.OutputStream
org.apache.cxf.io.CachedOutputStream
- All Implemented Interfaces:
- Closeable,- Flushable,- AutoCloseable
- Direct Known Subclasses:
- CacheAndWriteOutputStream,- WriteOnCloseOutputStream
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()static voidcopyStream(InputStream in, OutputStream out, int bufferSize) voidprotected voiddoClose()Perform any actions required on stream closure (handle response etc.)protected voiddoFlush()Perform any actions required on stream flush (freeze headers, reset output stream ... etc.)booleanvoidflush()byte[]getBytes()getOut()longinthashCode()voidstatic booleanReturns true if the default threshold is explicitly set via CachedConstants.THRESHOLD_SYS_PROPvoidLocks the output stream to prevent additional writes, but maintains a pointer to it so an InputStream can be obtainedprotected voidonWrite()protected voidPerform any actions required after stream closure (close the other related stream etc.)voidvoidvoidresetOut(OutputStream out, boolean copyOldContent) Replace the original stream with the new one, optionally copying the content of the old one into the new one.voidsetCipherTransformation(String cipherTransformation) static voidstatic voidsetDefaultMaxSize(long l) static voidsetDefaultThreshold(int i) voidsetMaxSize(long maxSize) voidsetOutputDir(File outputDir) voidsetThreshold(long threshold) longsize()toString()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwriteCacheTo(OutputStream out) voidvoidwriteCacheTo(StringBuilder out, long limit) voidwriteCacheTo(StringBuilder out, String charsetName) voidwriteCacheTo(StringBuilder out, String charsetName, long limit) Methods inherited from class java.io.OutputStreamnullOutputStream
- 
Field Details- 
outputLockedprotected boolean outputLocked
- 
currentStream
 
- 
- 
Constructor Details- 
CachedOutputStreampublic CachedOutputStream()
- 
CachedOutputStreampublic CachedOutputStream(long threshold) 
 
- 
- 
Method Details- 
holdTempFilepublic void holdTempFile()
- 
releaseTempFileHoldpublic void releaseTempFileHold()
- 
registerCallback
- 
deregisterCallback
- 
getCallbacks
- 
doFlushPerform any actions required on stream flush (freeze headers, reset output stream ... etc.)- Throws:
- IOException
 
- 
flush- Specified by:
- flushin interface- Flushable
- Overrides:
- flushin class- OutputStream
- Throws:
- IOException
 
- 
doClosePerform any actions required on stream closure (handle response etc.)- Throws:
- IOException
 
- 
postClosePerform any actions required after stream closure (close the other related stream etc.)- Throws:
- IOException
 
- 
lockOutputStreamLocks the output stream to prevent additional writes, but maintains a pointer to it so an InputStream can be obtained- Throws:
- IOException
 
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Overrides:
- closein class- OutputStream
- Throws:
- IOException
 
- 
equals
- 
resetOutReplace the original stream with the new one, optionally copying the content of the old one into the new one. When with Attachment, needs to replace the xml writer stream with the stream used by AttachmentSerializer or copy the cached output stream to the "real" output stream, i.e. onto the wire.- Parameters:
- out- the new output stream
- copyOldContent- flag indicating if the old content should be copied
- Throws:
- IOException
 
- 
copyStream- Throws:
- IOException
 
- 
sizepublic long size()
- 
getBytes- Throws:
- IOException
 
- 
writeCacheTo- Throws:
- IOException
 
- 
writeCacheTo- Throws:
- IOException
 
- 
writeCacheTo- Throws:
- IOException
 
- 
writeCacheTo- Throws:
- IOException
 
- 
writeCacheTo- Throws:
- IOException
 
- 
getOut- Returns:
- the underlying output stream
 
- 
hashCodepublic int hashCode()
- 
toString
- 
onWrite- Throws:
- IOException
 
- 
write- Overrides:
- writein class- OutputStream
- Throws:
- IOException
 
- 
write- Overrides:
- writein class- OutputStream
- Throws:
- IOException
 
- 
write- Specified by:
- writein class- OutputStream
- Throws:
- IOException
 
- 
getTempFile
- 
getInputStream- Throws:
- IOException
 
- 
setOutputDir- Throws:
- IOException
 
- 
getThresholdpublic long getThreshold()
- 
setThresholdpublic void setThreshold(long threshold) 
- 
setMaxSizepublic void setMaxSize(long maxSize) 
- 
setCipherTransformation
- 
setDefaultMaxSizepublic static void setDefaultMaxSize(long l) 
- 
setDefaultThresholdpublic static void setDefaultThreshold(int i) 
- 
isThresholdSysPropSetpublic static boolean isThresholdSysPropSet()Returns true if the default threshold is explicitly set via CachedConstants.THRESHOLD_SYS_PROP
- 
setDefaultCipherTransformation
 
-