public class CachedOutputStream extends OutputStream
StreamCache.DEFAULT_SPOOL_THRESHOLD bytes .
The temp file will store in the temp directory, you can configure it by setting the TEMP_DIR property. If you don't
set the TEMP_DIR property, it will choose the directory which is set by the system property of "java.io.tmpdir".
You can get a cached input stream of this stream. The temp file which is created with this output stream will be
deleted when you close this output stream or the cached fileInputStream(s) is/are closed after all the exchanges
using the temp file are completed.| Constructor and Description |
|---|
CachedOutputStream(org.apache.camel.Exchange exchange) |
CachedOutputStream(org.apache.camel.Exchange exchange,
boolean closedOnCompletion) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
equals(Object obj) |
void |
flush() |
OutputStream |
getCurrentStream() |
InputStream |
getInputStream() |
int |
getStrategyBufferSize() |
InputStream |
getWrappedInputStream() |
int |
hashCode() |
org.apache.camel.StreamCache |
newStreamCache()
Creates a new
StreamCache from the data cached in this OutputStream. |
String |
toString() |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public CachedOutputStream(org.apache.camel.Exchange exchange)
public CachedOutputStream(org.apache.camel.Exchange exchange,
boolean closedOnCompletion)
public void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic OutputStream getCurrentStream()
public 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 InputStream getInputStream() throws IOException
IOExceptionpublic InputStream getWrappedInputStream() throws IOException
IOExceptionpublic org.apache.camel.StreamCache newStreamCache()
throws IOException
StreamCache from the data cached in this OutputStream.IOExceptionpublic int getStrategyBufferSize()
Apache Camel