Class RtfDiskCache

java.lang.Object
com.lowagie.text.rtf.document.output.RtfDiskCache
All Implemented Interfaces:
RtfDataCache

public class RtfDiskCache extends Object implements RtfDataCache
The RtfFileCache is a RtfDataCache that uses a temporary file to store the rtf document data. Not so fast, but doesn't use any memory (just disk space).
Version:
$Revision: 3373 $
  • Field Details

    • data

      private final BufferedOutputStream data
      The BufferedOutputStream that stores the cache data.
    • tempFile

      private final File tempFile
      The temporary file to store the data in.
  • Constructor Details

    • RtfDiskCache

      public RtfDiskCache() throws IOException
      Constructs a RtfFileCache. Creates the temp file.
      Throws:
      IOException - If the temporary file could not be created.
  • Method Details

    • getOutputStream

      public OutputStream getOutputStream()
      Gets the BufferedOutputStream to write to.
      Specified by:
      getOutputStream in interface RtfDataCache
      Returns:
      The OutputStream the RtfDocument can use.
    • writeTo

      public void writeTo(OutputStream target) throws IOException
      Writes the content of the temporary file into the OutputStream.
      Specified by:
      writeTo in interface RtfDataCache
      Parameters:
      target - The OutputStream to write the content into.
      Throws:
      IOException - If an error occurs reading/writing.