net.sf.jasperreports.engine.util
Class FileBufferedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by net.sf.jasperreports.engine.util.FileBufferedOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class FileBufferedOutputStream
extends OutputStream

Version:
$Id: FileBufferedOutputStream.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Nested Class Summary
protected  class FileBufferedOutputStream.DataStream
           
 
Field Summary
static int DEFAULT_INITIAL_MEMORY_BUFFER_SIZE
           
static int DEFAULT_INPUT_BUFFER_LENGTH
           
static int INFINIT_MEMORY_THRESHOLD
           
static 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.
 
Constructor Summary
FileBufferedOutputStream()
           
FileBufferedOutputStream(int memoryThreshold)
           
FileBufferedOutputStream(int memoryThreshold, int initialMemoryBufferSize)
           
FileBufferedOutputStream(int memoryThreshold, int initialMemoryBufferSize, int inputBufferLength)
           
 
Method Summary
protected  int availableMemorySpace()
           
 void checkClosed()
           
 void close()
           
 void dispose()
           
protected  BufferedOutputStream ensureFileOutput()
           
protected  void finalize()
           
 void flush()
           
 InputStream getDataInputStream()
           
 int size()
           
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 void writeData(OutputStream out)
           
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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:
write in class OutputStream
Throws:
IOException

availableMemorySpace

protected int availableMemorySpace()

ensureFileOutput

protected BufferedOutputStream ensureFileOutput()
                                         throws IOException,
                                                FileNotFoundException
Throws:
IOException
FileNotFoundException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Overrides:
write in class OutputStream
Throws:
IOException

checkClosed

public void checkClosed()

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
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
Overrides:
finalize in class Object
Throws:
Throwable

getDataInputStream

public InputStream getDataInputStream()
                               throws IOException
Throws:
IOException


Copyright © 2012. All Rights Reserved.