Class RtfMemoryCache

  • All Implemented Interfaces:
    RtfDataCache

    public class RtfMemoryCache
    extends java.lang.Object
    implements RtfDataCache
    The RtfMemoryCache is an RtfDataCache that keeps the whole rtf document data in memory. Fast but memory intensive.
    Version:
    $Id: RtfMemoryCache.java 3373 2008-05-12 16:21:24Z xlv $
    • Constructor Summary

      Constructors 
      Constructor Description
      RtfMemoryCache()
      Constructs a RtfMemoryCache.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.OutputStream getOutputStream()
      Gets the ByteArrayOutputStream.
      void writeTo​(java.io.OutputStream target)
      Writes the content of the ByteArrayOutputStream into the OutputStream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        private final java.io.ByteArrayOutputStream data
        The buffer for the rtf document data.
    • Constructor Detail

      • RtfMemoryCache

        public RtfMemoryCache()
        Constructs a RtfMemoryCache.
    • Method Detail

      • getOutputStream

        public java.io.OutputStream getOutputStream()
        Gets the ByteArrayOutputStream.
        Specified by:
        getOutputStream in interface RtfDataCache
        Returns:
        The OutputStream the RtfDocument can use.
      • writeTo

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