public class CachedOutputStream extends OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected OutputStream |
currentStream |
protected boolean |
outputLocked |
| Constructor and Description |
|---|
CachedOutputStream() |
CachedOutputStream(long threshold) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static void |
copyStream(InputStream in,
OutputStream out,
int bufferSize) |
void |
deregisterCallback(CachedOutputStreamCallback 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 ... etc.)
|
boolean |
equals(Object obj) |
void |
flush() |
byte[] |
getBytes() |
List<CachedOutputStreamCallback> |
getCallbacks() |
InputStream |
getInputStream() |
OutputStream |
getOut() |
File |
getTempFile() |
long |
getThreshold() |
int |
hashCode() |
void |
holdTempFile() |
static boolean |
isThresholdSysPropSet()
Returns true if the default threshold is explicitly set via CachedConstants.THRESHOLD_SYS_PROP
|
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(CachedOutputStreamCallback cb) |
void |
releaseTempFileHold() |
void |
resetOut(OutputStream 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(String cipherTransformation) |
static void |
setDefaultCipherTransformation(String n) |
static void |
setDefaultMaxSize(long l) |
static void |
setDefaultThreshold(int i) |
void |
setMaxSize(long maxSize) |
void |
setOutputDir(File outputDir) |
void |
setThreshold(long threshold) |
long |
size() |
String |
toString() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
void |
writeCacheTo(OutputStream out) |
void |
writeCacheTo(StringBuilder out) |
void |
writeCacheTo(StringBuilder out,
long limit) |
void |
writeCacheTo(StringBuilder out,
String charsetName) |
void |
writeCacheTo(StringBuilder out,
String charsetName,
long limit) |
protected boolean outputLocked
protected OutputStream currentStream
public CachedOutputStream()
public CachedOutputStream(long threshold)
public void holdTempFile()
public void releaseTempFileHold()
public void registerCallback(CachedOutputStreamCallback cb)
public void deregisterCallback(CachedOutputStreamCallback cb)
public List<CachedOutputStreamCallback> getCallbacks()
protected void doFlush()
throws IOException
IOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionprotected void doClose()
throws IOException
IOExceptionprotected void postClose()
throws IOException
IOExceptionpublic void lockOutputStream()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void resetOut(OutputStream out, boolean copyOldContent) throws IOException
out - the new output streamcopyOldContent - flag indicating if the old content should be copiedIOExceptionpublic static void copyStream(InputStream in, OutputStream out, int bufferSize) throws IOException
IOExceptionpublic long size()
public byte[] getBytes()
throws IOException
IOExceptionpublic void writeCacheTo(OutputStream out) throws IOException
IOExceptionpublic void writeCacheTo(StringBuilder out, long limit) throws IOException
IOExceptionpublic void writeCacheTo(StringBuilder out, String charsetName, long limit) throws IOException
IOExceptionpublic void writeCacheTo(StringBuilder out) throws IOException
IOExceptionpublic void writeCacheTo(StringBuilder out, String charsetName) throws IOException
IOExceptionpublic OutputStream getOut()
protected void onWrite()
throws IOException
IOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic File getTempFile()
public InputStream getInputStream() throws IOException
IOExceptionpublic void setOutputDir(File outputDir) throws IOException
IOExceptionpublic long getThreshold()
public void setThreshold(long threshold)
public void setMaxSize(long maxSize)
public void setCipherTransformation(String cipherTransformation)
public static void setDefaultMaxSize(long l)
public static void setDefaultThreshold(int i)
public static boolean isThresholdSysPropSet()
public static void setDefaultCipherTransformation(String n)
Apache CXF