public class ThresholdOutputStream extends OutputStream
getInputStream() is called or call destroy() if the
InputStream isn't required!| Modifier and Type | Class and Description |
|---|---|
class |
ThresholdOutputStream.ThresholdInputStream
Provides information about the input stream.
|
| Constructor and Description |
|---|
ThresholdOutputStream(File tempDir,
int memoryThreshold,
long maxContentSize)
Constructor.
|
ThresholdOutputStream(File tempDir,
int memoryThreshold,
long maxContentSize,
boolean encrypt)
Constructor.
|
ThresholdOutputStream(int initSize,
File tempDir,
int memoryThreshold,
long maxContentSize,
boolean encrypt)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
destroy()
Destroys the object before it has been read.
|
void |
flush() |
InputStream |
getInputStream()
Returns the data as an InputStream.
|
long |
getSize() |
void |
write(byte[] buffer) |
void |
write(byte[] buffer,
int offset,
int len) |
void |
write(int oneByte) |
public ThresholdOutputStream(File tempDir, int memoryThreshold, long maxContentSize)
tempDir - temp directory or null for the default temp
directorymemoryThreshold - memory threshold in bytesmaxContentSize - max size of the content in bytes (-1 to disable the check)public ThresholdOutputStream(File tempDir, int memoryThreshold, long maxContentSize, boolean encrypt)
tempDir - temp directory or null for the default temp
directorymemoryThreshold - memory threshold in bytesmaxContentSize - max size of the content in bytes (-1 to disable the check)public ThresholdOutputStream(int initSize,
File tempDir,
int memoryThreshold,
long maxContentSize,
boolean encrypt)
initSize - initial internal buffer sizetempDir - temp directory or null for the default temp
directorymemoryThreshold - memory threshold in bytesmaxContentSize - max size of the content in bytes (-1 to disable the check)encrypt - indicates if temporary files must be encryptedpublic long getSize()
public void write(byte[] buffer)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] buffer,
int offset,
int len)
throws IOException
write in class OutputStreamIOExceptionpublic void write(int oneByte)
throws IOException
write in class OutputStreamIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class OutputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamIOExceptionpublic void destroy()
public InputStream getInputStream() throws IOException
IOExceptionCopyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.