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 Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public OutputStream getCurrentStream()
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b) throws IOException
write
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public InputStream getInputStream() throws IOException
IOException
public InputStream getWrappedInputStream() throws IOException
IOException
public org.apache.camel.StreamCache newStreamCache() throws IOException
StreamCache
from the data cached in this OutputStream
.IOException
public int getStrategyBufferSize()
Apache Camel