Package com.google.android.exoplayer2.metadata.id3

## Class Id3Decoder

- java.lang.Object
- - com.google.android.exoplayer2.metadata.SimpleMetadataDecoder
  - - com.google.android.exoplayer2.metadata.id3.Id3Decoder

- All Implemented Interfaces:
    `MetadataDecoder`

      public final class Id3Decoder
      extends SimpleMetadataDecoder

  Decodes ID3 tags.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `Id3Decoder.FramePredicate` | A predicate for determining whether individual frames should be decoded.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `ID3_HEADER_LENGTH` | Length of an ID3 tag header.
    `static int` | `ID3_TAG` | The first three bytes of a well formed ID3 tag header.
    `static Id3Decoder.FramePredicate` | `NO_FRAMES_PREDICATE` | A predicate that indicates no frames should be decoded.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Id3Decoder()` |
    `Id3Decoder​(Id3Decoder.FramePredicate framePredicate)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Metadata` | `decode​(byte[] data, int size)` | Decodes ID3 tags.
    `protected Metadata` | `decode​(MetadataInputBuffer inputBuffer, ByteBuffer buffer)` | Called by `SimpleMetadataDecoder.decode(MetadataInputBuffer)` after input buffer validation has been performed, except in the case that `Buffer.isDecodeOnly()` is `true`.

    - ### Methods inherited from class com.google.android.exoplayer2.metadata.SimpleMetadataDecoder

      `decode`

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

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

- - ### Field Detail

    - #### NO_FRAMES_PREDICATE

          public static final Id3Decoder.FramePredicate NO_FRAMES_PREDICATE

      A predicate that indicates no frames should be decoded.

    - #### ID3_TAG

          public static final int ID3_TAG

      The first three bytes of a well formed ID3 tag header.
      See Also:
        Constant Field Values

    - #### ID3_HEADER_LENGTH

          public static final int ID3_HEADER_LENGTH

      Length of an ID3 tag header.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Id3Decoder

          public Id3Decoder()

    - #### Id3Decoder

          public Id3Decoder​(@Nullable
                            Id3Decoder.FramePredicate framePredicate)

      Parameters:
        `framePredicate` - Determines which frames are decoded. May be null to decode all frames.

  - ### Method Detail

    - #### decode

          @Nullable
          protected Metadata decode​(MetadataInputBuffer inputBuffer,
                                    ByteBuffer buffer)

      Description copied from class: `SimpleMetadataDecoder`
      Called by `SimpleMetadataDecoder.decode(MetadataInputBuffer)` after input buffer validation has been performed, except in the case that `Buffer.isDecodeOnly()` is `true`.
      Specified by:
        `decode` in class `SimpleMetadataDecoder`
      Parameters:
        `inputBuffer` - The input buffer to decode.
        `buffer` - The input buffer's `data buffer`, for convenience. Validation by `SimpleMetadataDecoder.decode(com.google.android.exoplayer2.metadata.MetadataInputBuffer)` guarantees that `ByteBuffer.hasArray()`, `Buffer.position()` and `ByteBuffer.arrayOffset()` are `true`, `0` and `0` respectively.
      Returns:
        The decoded metadata object, or `null` if the metadata could not be decoded.

    - #### decode

          @Nullable
          public Metadata decode​(byte[] data,
                                 int size)

      Decodes ID3 tags.
      Parameters:
        `data` - The bytes to decode ID3 tags from.
        `size` - Amount of bytes in `data` to read.
      Returns:
        A `Metadata` object containing the decoded ID3 tags, or null if the data could not be decoded.