Package net.sf.jasperreports.engine.util
Class FileBufferedOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- net.sf.jasperreports.engine.util.FileBufferedOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class FileBufferedOutputStream extends OutputStream
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFileBufferedOutputStream.DataStream
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_INITIAL_MEMORY_BUFFER_SIZEstatic intDEFAULT_INPUT_BUFFER_LENGTHstatic StringEXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_ALREADY_CLOSEDstatic intINFINIT_MEMORY_THRESHOLDstatic StringPROPERTY_MEMORY_THRESHOLDSpecifies the maximum in-memory buffer length that triggers the creation of a temporary file on disk to store further content sent to this output stream.
-
Constructor Summary
Constructors Constructor Description FileBufferedOutputStream()FileBufferedOutputStream(int memoryThreshold)FileBufferedOutputStream(int memoryThreshold, int initialMemoryBufferSize)FileBufferedOutputStream(int memoryThreshold, int initialMemoryBufferSize, int inputBufferLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intavailableMemorySpace()voidcheckClosed()voidclose()voiddispose()protected BufferedOutputStreamensureFileOutput()protected voidfinalize()voidflush()InputStreamgetDataInputStream()intsize()voidwrite(byte[] b, int off, int len)voidwrite(int b)voidwriteData(OutputStream out)-
Methods inherited from class java.io.OutputStream
nullOutputStream, write
-
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_ALREADY_CLOSED
public static final String EXCEPTION_MESSAGE_KEY_OUTPUT_STREAM_ALREADY_CLOSED
- See Also:
- Constant Field Values
-
PROPERTY_MEMORY_THRESHOLD
public static final String PROPERTY_MEMORY_THRESHOLD
Specifies the maximum in-memory buffer length that triggers the creation of a temporary file on disk to store further content sent to this output stream.- See Also:
- Constant Field Values
-
INFINIT_MEMORY_THRESHOLD
public static final int INFINIT_MEMORY_THRESHOLD
- See Also:
- Constant Field Values
-
DEFAULT_INITIAL_MEMORY_BUFFER_SIZE
public static final int DEFAULT_INITIAL_MEMORY_BUFFER_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_INPUT_BUFFER_LENGTH
public static final int DEFAULT_INPUT_BUFFER_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FileBufferedOutputStream
public FileBufferedOutputStream()
-
FileBufferedOutputStream
public FileBufferedOutputStream(int memoryThreshold)
-
FileBufferedOutputStream
public FileBufferedOutputStream(int memoryThreshold, int initialMemoryBufferSize)
-
FileBufferedOutputStream
public FileBufferedOutputStream(int memoryThreshold, int initialMemoryBufferSize, int inputBufferLength)
-
-
Method Detail
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
availableMemorySpace
protected int availableMemorySpace()
-
ensureFileOutput
protected BufferedOutputStream ensureFileOutput() throws IOException, FileNotFoundException
- Throws:
IOExceptionFileNotFoundException
-
write
public void write(byte[] b, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
checkClosed
public void checkClosed()
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
size
public int size()
-
writeData
public void writeData(OutputStream out) throws IOException
- Throws:
IOException
-
dispose
public void dispose()
-
finalize
protected void finalize() throws Throwable
-
getDataInputStream
public InputStream getDataInputStream() throws IOException
- Throws:
IOException
-
-