org.apache.poi.hdgf.chunks

## Class ChunkFactory

- java.lang.Object
- - org.apache.poi.hdgf.chunks.ChunkFactory

-     public final class ChunkFactory
      extends java.lang.Object

  Factor class to create the appropriate chunks, which needs the version of the file to process the chunk header and trailer areas. Makes use of chunks_parse_cmds.tbl from vsdump to be able to process the chunk value area

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ChunkFactory.CommandDefinition` The definition of a Command, which a chunk may hold.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChunkFactory(int version)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Chunk` | `createChunk(byte[] data, int offset)` Creates the appropriate chunk at the given location.
    `int` | `getVersion()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ChunkFactory

          public ChunkFactory(int version)
                       throws java.io.IOException

      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### getVersion

          public int getVersion()

    - #### createChunk

          public Chunk createChunk(byte[] data,
                                   int offset)

      Creates the appropriate chunk at the given location.
      Parameters:
        `data` - the chunk bytes
        `offset` - the offset into the chunk bytes array to start reading from
      Returns:
        the new Chunk

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.