com.beaglebuddy.id3.v24.frame_body

## Class ID3v24FrameBodySignature

- java.lang.Object
- - com.beaglebuddy.util.Utility
  - - com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodyUtility
    - - com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBody
      - - com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodySignature

-     public class ID3v24FrameBodySignature
      extends ID3v24FrameBody

  A signature frame body enables a group of frames, grouped with `GRID` frames, to be signed. Although signatures can reside inside the `group id registration frame`, it might be desirable to store the signature elsewhere, e.g. in watermarks.

  Seek Frame Body Fields
  | Field | Description
  --- | --- | ---
  1. | id | a number from 0 - 255 which uniquely identifies the group.
  2. | signature | binary signature of the group.

  There may be more than one signature frame in in an ID3v2.4 `tag`, but no two may have the same group id.

  See Also:
    `ID3v24Frame`, ID3 tag version 2.4.0 standard, wikipedia history of ID3 tags

- - ### Field Summary

    - ### Fields inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBody

      `buffer, dirty, frameType`

    - ### Fields inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodyUtility

      `nextNullTerminatorIndex, nullTerminatorIndex`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ID3v24FrameBodySignature()` The constructor is called when creating a new frame.
    `ID3v24FrameBodySignature(byte id, byte[] signature)` This constructor is called when creating a new frame.
    `ID3v24FrameBodySignature(java.io.InputStream inputStream, int frameBodySize)` This constructor is called when reading in an existing frame from an .mp3 file.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte` | `getId()` gets the unique id of the group.
    `byte[]` | `getSignature()` gets the binary signature of the group.
    `void` | `parse()` parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
    `void` | `setBuffer()` If the frame body's values have been modified, then resize the raw binary buffer and store the new values there.
    `void` | `setId(byte id)` sets the unique id of the group.
    `void` | `setSignature(byte[] signature)` sets the binary signature of the group.
    `java.lang.String` | `toString()` gets a string representation of the signature frame body.

    - ### Methods inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBody

      `getFrameType, getNextNullTerminator, getSize, isDirty, save, save`

    - ### Methods inherited from class com.beaglebuddy.id3.v24.frame_body.ID3v24FrameBodyUtility

      `getNextNullTerminator, pricesToString, stringToBytes`

    - ### Methods inherited from class com.beaglebuddy.util.Utility

      `bytesToInt, bytesToInt, bytesToShort, bytesToShort, bytesToSynchsafeInt, bytesToSynchsafeShort, formateDate, hex, hex, hex, intToBytes, littleEndianBytesToInt, pad, shortToBytes, synchsafeIntToBytes`

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

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

- - ### Constructor Detail

    - #### ID3v24FrameBodySignature

          public ID3v24FrameBodySignature()

      The constructor is called when creating a new frame. The default values used are:
      - group id of 0
      - empty signature

    - #### ID3v24FrameBodySignature

          public ID3v24FrameBodySignature(byte id,
                                  byte[] signature)

      This constructor is called when creating a new frame.
      Parameters:
        `id` - a number from 0 - 255 which uniquely identifies the group.
        `signature` - the binary signature of the group.

    - #### ID3v24FrameBodySignature

          public ID3v24FrameBodySignature(java.io.InputStream inputStream,
                                  int frameBodySize)
                                   throws java.io.IOException

      This constructor is called when reading in an existing frame from an .mp3 file. This is then followed by a call to the parse() method.
      Parameters:
        `inputStream` - input stream pointing to a signature frame body in the .mp3 file.
        `frameBodySize` - size (in bytes) of the frame's body.
      Throws:
        `java.io.IOException` - if there is an error while reading the frame body.

  - ### Method Detail

    - #### parse

          public void parse()
                     throws java.lang.IllegalArgumentException

      parses the raw bytes of the frame body and stores the parsed values in the frame's fields.
      Overrides:
        `parse` in class `ID3v24FrameBody`
      Throws:
        `java.lang.IllegalArgumentException` - if an invalid value is detected while parsing the frame body's raw bytes.

    - #### getId

          public byte getId()

      gets the unique id of the group.
      Returns:
        a number from 0 - 255 which uniquely identifies the group.
      See Also:
        `setId(byte)`

    - #### setId

          public void setId(byte id)

      sets the unique id of the group.
      Parameters:
        `id` - a number from 0 - 255 which uniquely identifies the group
      See Also:
        `getId()`

    - #### getSignature

          public byte[] getSignature()

      gets the binary signature of the group.
      Returns:
        the binary signature of the group.
      See Also:
        `setSignature(byte[])`

    - #### setSignature

          public void setSignature(byte[] signature)

      sets the binary signature of the group.
      Parameters:
        `signature` - the binary signature of the group.
      See Also:
        `getSignature()`

    - #### setBuffer

          public void setBuffer()

      If the frame body's values have been modified, then resize the raw binary buffer and store the new values there. When finished, the dirty flag is reset to indicate that the buffer is up to date, and the frame is now ready to be saved to the .mp3 file.
      Overrides:
        `setBuffer` in class `ID3v24FrameBody`

    - #### toString

          public java.lang.String toString()

      gets a string representation of the signature frame body.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of the frame body.