Class CompoundFileWriter


  • public final class CompoundFileWriter
    extends Object
    Combines multiple files into a single compound file. The file format:
    • VInt fileCount
    • {Directory} fileCount entries with the following structure:
      • long dataOffset
      • String fileName
    • {File Data} fileCount entries with the raw data of the corresponding file
    The fileCount integer indicates how many files are contained in this compound file. The {directory} that follows has that many entries. Each directory entry contains a long pointer to the start of this file's data section, and a String with that file's name.
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Constructor Detail

      • CompoundFileWriter

        public CompoundFileWriter​(Directory dir,
                                  String name)
        Create the compound stream in the specified file. The file name is the entire name (no extensions are added).
        Throws:
        NullPointerException - if dir or name is null
    • Method Detail

      • getDirectory

        public Directory getDirectory()
        Returns the directory of the compound file.
      • getName

        public String getName()
        Returns the name of the compound file.
      • close

        public void close()
                   throws IOException
        Merge files with the extensions added up to now. All files with these extensions are combined sequentially into the compound stream.
        Throws:
        IllegalStateException - if close() had been called before or if no file has been added to this object
        IOException