org.apache.poi.hwpf.model

## Class PieceDescriptor

- java.lang.Object
- - org.apache.poi.hwpf.model.PieceDescriptor

- All Implemented Interfaces:
    Duplicatable

      @Internal
      public final class PieceDescriptor
      extends java.lang.Object
      implements Duplicatable

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PieceDescriptor(byte[] buf, int offset)`
    `PieceDescriptor(byte[] buf, int offset, java.nio.charset.Charset charset)` This initializer should only be used for HWPFOldDocuments.
    `PieceDescriptor(PieceDescriptor other)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PieceDescriptor` | `copy()`
    `boolean` | `equals(java.lang.Object obj)`
    `java.nio.charset.Charset` | `getCharset()`
    `int` | `getFilePosition()`
    `PropertyModifier` | `getPrm()`
    `static int` | `getSizeInBytes()`
    `int` | `hashCode()`
    `boolean` | `isUnicode()`
    `void` | `setFilePosition(int pos)`
    `protected byte[]` | `toByteArray()`
    `java.lang.String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### PieceDescriptor

          public PieceDescriptor(PieceDescriptor other)

    - #### PieceDescriptor

          public PieceDescriptor(byte[] buf,
                                 int offset)

    - #### PieceDescriptor

          public PieceDescriptor(byte[] buf,
                                 int offset,
                                 java.nio.charset.Charset charset)

      This initializer should only be used for HWPFOldDocuments.
      Parameters:
        `buf` - The buffer to read data from
        `offset` - The offset into the buffer to start reading from
        `charset` - which charset to use if this is not unicode

  - ### Method Detail

    - #### getFilePosition

          public int getFilePosition()

    - #### setFilePosition

          public void setFilePosition(int pos)

    - #### isUnicode

          public boolean isUnicode()

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### getCharset

          public java.nio.charset.Charset getCharset()

      Returns:
        charset to use if this is not a Unicode PieceDescriptor this can be `null`

    - #### getPrm

          public PropertyModifier getPrm()

    - #### toByteArray

          protected byte[] toByteArray()

    - #### getSizeInBytes

          public static int getSizeInBytes()

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### copy

          public PieceDescriptor copy()

      Specified by:
        `copy` in interface `Duplicatable`
      Returns:
        a deep copy of the implementing class / instance

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