Class TempFileCharacterInput


  • public class TempFileCharacterInput
    extends CharacterInput
    This class represents a temporary file character input stream. Call the "done" method to clean up the file when done. NOTE: The implied flow of this method is to be handed a file that has already been created by some means. The file must be a dedicated temporary file, which can be destroyed when the data has been used. However, this class can also buffer data in memory if the data is not too large (that is, less than a supplied cutoff value).
    • Field Detail

      • file

        protected java.io.File file
      • inMemoryBuffer

        protected byte[] inMemoryBuffer
    • Constructor Detail

      • TempFileCharacterInput

        public TempFileCharacterInput​(java.io.Reader is)
                               throws ManifoldCFException,
                                      java.io.IOException
        Construct from a non-length-delimited reader.
        Parameters:
        is - is a reader to transfer from, to the end of the data. This will, as a side effect, also calculate the character length and hash value for the data.
        Throws:
        ManifoldCFException
        java.io.IOException
      • TempFileCharacterInput

        public TempFileCharacterInput​(java.io.Reader is,
                                      long length)
                               throws ManifoldCFException,
                                      java.io.IOException
        Construct from a length-delimited reader.
        Parameters:
        is - is a reader to transfer from, to the end of the data. This will, as a side effect, also calculate the character length and hash value for the data.
        length - is the length limit to transfer, or -1 if no limit
        Throws:
        ManifoldCFException
        java.io.IOException
      • TempFileCharacterInput

        public TempFileCharacterInput​(java.io.Reader is,
                                      long length,
                                      int maxInMemoryLength)
                               throws ManifoldCFException,
                                      java.io.IOException
        Construct from a length-delimited reader.
        Parameters:
        is - is a reader to transfer from, to the end of the data. This will, as a side effect, also calculate the character length and hash value for the data.
        length - is the length limit to transfer, or -1 if no limit
        maxInMemoryLength - is the maximum size to keep in memory, before using a backing File object. The amount possibly saved in memory will be guaranteed less than this size.
        Throws:
        ManifoldCFException
        java.io.IOException
      • TempFileCharacterInput

        public TempFileCharacterInput​(java.io.File tempFile)
        Construct from an existing temporary fle.
        Parameters:
        tempFile - is the existing temporary file, encoded in utf-8.
      • TempFileCharacterInput

        protected TempFileCharacterInput()