public final class DeferredFileOutputStream extends OutputStream
| Modifier and Type | Field and Description |
|---|---|
protected OutputStream |
output |
static String |
TMPFILE_PREFIX |
static String |
TMPFILE_SUFFIX |
| Constructor and Description |
|---|
DeferredFileOutputStream(int transitionSize) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkThreshold(int count)
Checks whether reading count bytes would cross the limit.
|
void |
close() |
void |
flush() |
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.
|
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public static final String TMPFILE_PREFIX
public static final String TMPFILE_SUFFIX
protected OutputStream output
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
current - 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 AutoCloseableIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int b)
throws IOException
write in class OutputStreamIOExceptionprotected void checkThreshold(int count)
throws IOException
IOExceptionCopyright © 2006–2024. All rights reserved.