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, writepublic 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
ThresholdingOutputStreamthresholdReached in class ThresholdingOutputStreamcurrent - is the current number of bytes that have been writtenpredicted - is the total number after the write completesIOExceptionpublic InputStream getInputStream() throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ThresholdingOutputStreamIOExceptionCopyright © 2006–2021. All rights reserved.