public class DeferredFileOutputStream extends ThresholdingOutputStream
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TMPFILE_PREFIX |
static java.lang.String |
TMPFILE_SUFFIX |
output
Constructor and Description |
---|
DeferredFileOutputStream(int transitionSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
java.io.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 java.lang.String TMPFILE_PREFIX
public static final java.lang.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 java.io.IOException
ThresholdingOutputStream
thresholdReached
in class ThresholdingOutputStream
current
- is the current number of bytes that have been writtenpredicted
- is the total number after the write completesjava.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class ThresholdingOutputStream
java.io.IOException
Copyright © 2006–2019. All rights reserved.