Class ChmPmglHeader

  • All Implemented Interfaces:
    java.io.Serializable, ChmAccessor<ChmPmglHeader>

    public class ChmPmglHeader
    extends java.lang.Object
    implements ChmAccessor<ChmPmglHeader>
    Description There are two types of directory chunks -- index chunks, and listing chunks. The index chunk will be omitted if there is only one listing chunk. A listing chunk has the following format: 0000: char[4] 'PMGL' 0004: DWORD Length of free space and/or quickref area at end of directory chunk 0008: DWORD Always 0 000C: DWORD Chunk number of previous listing chunk when reading directory in sequence (-1 if this is the first listing chunk) 0010: DWORD Chunk number of next listing chunk when reading directory in sequence (-1 if this is the last listing chunk) 0014: Directory listing entries (to quickref area) Sorted by filename; the sort is case-insensitive The quickref area is written backwards from the end of the chunk. One quickref entry exists for every n entries in the file, where n is calculated as 1 + (1 << quickref density). So for density = 2, n = 5 Chunklen-0002: WORD Number of entries in the chunk Chunklen-0004: WORD Offset of entry n from entry 0 Chunklen-0008: WORD Offset of entry 2n from entry 0 Chunklen-000C: WORD Offset of entry 3n from entry 0 ... The format of a directory listing entry is as follows BYTE: length of name BYTEs: name (UTF-8 encoded) ENCINT: content section ENCINT: offset ENCINT: length The offset is from the beginning of the content section the file is in, after the section has been decompressed (if appropriate). The length also refers to length of the file in the section after decompression. There are two kinds of file represented in the directory: user data and format related files. The files which are format-related have names which begin with '::', the user data files have names which begin with "/".
    See Also:
    Serialized Form
    • Constructor Detail

      • ChmPmglHeader

        public ChmPmglHeader()
    • Method Detail

      • getFreeSpace

        public long getFreeSpace()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getSignature

        public byte[] getSignature()
      • getUnknown0008

        public long getUnknown0008()
      • getBlockPrev

        public int getBlockPrev()
      • getBlockNext

        public int getBlockNext()