Class ChmPmglHeader

java.lang.Object
org.apache.tika.parser.microsoft.chm.ChmPmglHeader
All Implemented Interfaces:
Serializable, ChmAccessor<ChmPmglHeader>

public class ChmPmglHeader extends 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:
  • Constructor Details

    • ChmPmglHeader

      public ChmPmglHeader()
  • Method Details

    • getFreeSpace

      public long getFreeSpace()
    • setFreeSpace

      public void setFreeSpace(long free_space) throws TikaException
      Throws:
      TikaException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • unmarshalCharArray

      protected void unmarshalCharArray(byte[] data, ChmPmglHeader chmPmglHeader, int count) throws TikaException
      Throws:
      TikaException
    • parse

      public void parse(byte[] data, ChmPmglHeader chmPmglHeader) throws TikaException
      Description copied from interface: ChmAccessor
      Parses chm accessor
      Specified by:
      parse in interface ChmAccessor<ChmPmglHeader>
      Parameters:
      data - chm file
      Throws:
      TikaException
    • getSignature

      public byte[] getSignature()
    • setSignature

      protected void setSignature(byte[] signature)
    • getUnknown0008

      public long getUnknown0008()
    • setUnknown0008

      protected void setUnknown0008(long unknown_0008)
    • getBlockPrev

      public int getBlockPrev()
    • setBlockPrev

      protected void setBlockPrev(int block_prev)
    • getBlockNext

      public int getBlockNext()
    • setBlockNext

      protected void setBlockNext(int block_next)