public class DeferredFileOutputStream extends ThresholdingOutputStream
Modifier and Type | Field and Description |
---|---|
static String |
TMPFILE_PREFIX |
static String |
TMPFILE_SUFFIX |
output
Constructor and Description |
---|
DeferredFileOutputStream(int transitionSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
InputStream |
getInputStream()
Closes the output stream and creates an InputStream on the same data.
|
protected void |
thresholdReached(int current,
int predicted)
Called when the threshold is about to be exceeded.
|
checkThreshold, flush, getThreshold, write, write, write
public static final String TMPFILE_PREFIX
public static final String TMPFILE_SUFFIX
public DeferredFileOutputStream(int transitionSize)
transitionSize
- is the number of bytes at which to convert
from a byte array to a real file.protected void thresholdReached(int current, int predicted) throws IOException
ThresholdingOutputStream
thresholdReached
in class ThresholdingOutputStream
current
- is the current number of bytes that have been writtenpredicted
- is the total number after the write completesIOException
public InputStream getInputStream() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class ThresholdingOutputStream
IOException
Copyright © 2006–2018. All rights reserved.