Package org.apache.cxf.io
Class CachedWriter
java.lang.Object
java.io.Writer
org.apache.cxf.io.CachedWriter
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
- Direct Known Subclasses:
- XSLTOutInterceptor.XSLTCachedWriter
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()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()char[]getChars()getOut()inthashCode()voidvoidLocks 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.)voidvoidvoidReplace 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(char[] cbuf, int off, int len) voidwriteCacheTo(Writer out) voidvoidwriteCacheTo(StringBuilder out, long limit) 
- 
Field Details- 
outputLockedprotected boolean outputLocked
- 
currentStream
 
- 
- 
Constructor Details- 
CachedWriterpublic CachedWriter()
- 
CachedWriterpublic CachedWriter(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
- Specified by:
- flushin class- Writer
- 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
- Specified by:
- closein class- Writer
- 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
 
- 
sizepublic long size()
- 
getChars- 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- Specified by:
- writein class- Writer
- Throws:
- IOException
 
- 
getTempFile
- 
getReader- Throws:
- IOException
 
- 
setOutputDir- Throws:
- IOException
 
- 
setThresholdpublic void setThreshold(long threshold) 
- 
setMaxSizepublic void setMaxSize(long maxSize) 
- 
setCipherTransformation
- 
setDefaultMaxSizepublic static void setDefaultMaxSize(long l) 
- 
setDefaultThresholdpublic static void setDefaultThreshold(int i) 
- 
setDefaultCipherTransformation
 
-