public class CachedWriter
extends java.io.Writer
| Modifier and Type | Field and Description |
|---|---|
protected java.io.Writer |
currentStream |
protected boolean |
outputLocked |
| Constructor and Description |
|---|
CachedWriter() |
CachedWriter(long threshold) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
deregisterCallback(CachedWriterCallback cb) |
protected void |
doClose()
Perform any actions required on stream closure (handle response etc.)
|
protected void |
doFlush()
Perform any actions required on stream flush (freeze headers, reset
output stream ...
|
boolean |
equals(java.lang.Object obj) |
void |
flush() |
java.util.List<CachedWriterCallback> |
getCallbacks() |
char[] |
getChars() |
java.io.Writer |
getOut() |
java.io.Reader |
getReader() |
java.io.File |
getTempFile() |
int |
hashCode() |
void |
holdTempFile() |
void |
lockOutputStream()
Locks the output stream to prevent additional writes, but maintains
a pointer to it so an InputStream can be obtained
|
protected void |
onWrite() |
protected void |
postClose()
Perform any actions required after stream closure (close the other related stream etc.)
|
void |
registerCallback(CachedWriterCallback cb) |
void |
releaseTempFileHold() |
void |
resetOut(java.io.Writer out,
boolean copyOldContent)
Replace the original stream with the new one, optionally copying the content of the old one
into the new one.
|
void |
setCipherTransformation(java.lang.String cipherTransformation) |
static void |
setDefaultCipherTransformation(java.lang.String n) |
static void |
setDefaultMaxSize(long l) |
static void |
setDefaultThreshold(int i) |
void |
setMaxSize(long maxSize) |
void |
setOutputDir(java.io.File outputDir) |
void |
setThreshold(long threshold) |
long |
size() |
java.lang.String |
toString() |
void |
write(char[] cbuf,
int off,
int len) |
void |
writeCacheTo(java.lang.StringBuilder out) |
void |
writeCacheTo(java.lang.StringBuilder out,
long limit) |
void |
writeCacheTo(java.io.Writer out) |
protected boolean outputLocked
protected java.io.Writer currentStream
public CachedWriter()
public CachedWriter(long threshold)
public void holdTempFile()
public void releaseTempFileHold()
public void registerCallback(CachedWriterCallback cb)
public void deregisterCallback(CachedWriterCallback cb)
public java.util.List<CachedWriterCallback> getCallbacks()
protected void doFlush()
throws java.io.IOException
java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOExceptionprotected void doClose()
throws java.io.IOException
java.io.IOExceptionprotected void postClose()
throws java.io.IOException
java.io.IOExceptionpublic void lockOutputStream()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void resetOut(java.io.Writer out,
boolean copyOldContent)
throws java.io.IOException
out - the new output streamcopyOldContent - flag indicating if the old content should be copiedjava.io.IOExceptionpublic long size()
public char[] getChars()
throws java.io.IOException
java.io.IOExceptionpublic void writeCacheTo(java.io.Writer out)
throws java.io.IOException
java.io.IOExceptionpublic void writeCacheTo(java.lang.StringBuilder out,
long limit)
throws java.io.IOException
java.io.IOExceptionpublic void writeCacheTo(java.lang.StringBuilder out)
throws java.io.IOException
java.io.IOExceptionpublic java.io.Writer getOut()
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectprotected void onWrite()
throws java.io.IOException
java.io.IOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic java.io.File getTempFile()
public java.io.Reader getReader()
throws java.io.IOException
java.io.IOExceptionpublic void setOutputDir(java.io.File outputDir)
throws java.io.IOException
java.io.IOExceptionpublic void setThreshold(long threshold)
public void setMaxSize(long maxSize)
public void setCipherTransformation(java.lang.String cipherTransformation)
public static void setDefaultMaxSize(long l)
public static void setDefaultThreshold(int i)
public static void setDefaultCipherTransformation(java.lang.String n)