Package com.google.android.exoplayer2.metadata

## Class SimpleMetadataDecoder

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

- All Implemented Interfaces:
    `MetadataDecoder`
  Direct Known Subclasses:
    `AppInfoTableDecoder`, `EventMessageDecoder`, `IcyDecoder`, `Id3Decoder`, `SpliceInfoDecoder`

      public abstract class SimpleMetadataDecoder
      extends Object
      implements MetadataDecoder

  A `MetadataDecoder` base class that validates input buffers and discards any for which `Buffer.isDecodeOnly()` is `true`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SimpleMetadataDecoder()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Metadata` | `decode​(MetadataInputBuffer inputBuffer)` | Decodes a `Metadata` element from the provided input buffer.
    `protected abstract Metadata` | `decode​(MetadataInputBuffer inputBuffer, ByteBuffer buffer)` | Called by `decode(MetadataInputBuffer)` after input buffer validation has been performed, except in the case that `Buffer.isDecodeOnly()` is `true`.

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

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

- - ### Constructor Detail

    - #### SimpleMetadataDecoder

          public SimpleMetadataDecoder()

  - ### Method Detail

    - #### decode

          @Nullable
          public final Metadata decode​(MetadataInputBuffer inputBuffer)

      Description copied from interface: `MetadataDecoder`
      Decodes a `Metadata` element from the provided input buffer.

      Respects `Buffer.limit()` of `inputBuffer.data`, but assumes `Buffer.position()` and `ByteBuffer.arrayOffset()` are both zero and `ByteBuffer.hasArray()` is true.

      Specified by:
        `decode` in interface `MetadataDecoder`
      Parameters:
        `inputBuffer` - The input buffer to decode.
      Returns:
        The decoded metadata object, or `null` if the metadata could not be decoded or if `Buffer.isDecodeOnly()` was set on the input buffer.

    - #### decode

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

      Called by `decode(MetadataInputBuffer)` after input buffer validation has been performed, except in the case that `Buffer.isDecodeOnly()` is `true`.
      Parameters:
        `inputBuffer` - The input buffer to decode.
        `buffer` - The input buffer's `data buffer`, for convenience. Validation by `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.