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 all cached
fileInputStream is closed after the exchange is completed.Modifier and Type | Field and Description |
---|---|
static String |
BUFFER_SIZE
Deprecated.
|
static String |
CIPHER_TRANSFORMATION
Deprecated.
|
static String |
TEMP_DIR
Deprecated.
|
static String |
THRESHOLD
Deprecated.
|
Constructor and Description |
---|
CachedOutputStream(Exchange exchange) |
CachedOutputStream(Exchange exchange,
boolean closedOnCompletion) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
equals(Object obj) |
void |
flush() |
int |
getBufferSize()
Deprecated.
|
OutputStream |
getCurrentStream() |
InputStream |
getInputStream() |
int |
getStrategyBufferSize() |
StreamCache |
getStreamCache()
Deprecated.
use
newStreamCache() |
InputStream |
getWrappedInputStream() |
int |
hashCode() |
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) |
@Deprecated public static final String THRESHOLD
@Deprecated public static final String BUFFER_SIZE
@Deprecated public static final String TEMP_DIR
@Deprecated public static final String CIPHER_TRANSFORMATION
public CachedOutputStream(Exchange exchange)
public CachedOutputStream(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
@Deprecated public StreamCache getStreamCache() throws IOException
newStreamCache()
IOException
public StreamCache newStreamCache() throws IOException
StreamCache
from the data cached in this OutputStream
.IOException
@Deprecated public int getBufferSize()
getStrategyBufferSize()
public int getStrategyBufferSize()
Apache Camel