KLVData (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.model

## Interface KLVData

- All Superinterfaces:
    InterchangeObject, MediaEntity, MetadataObject
  All Known Implementing Classes:
    KLVDataImpl

      public interface KLVData
      extends InterchangeObject

  Specifies a container for user data specified with a key (SMPTE label), length and value. SMPTE KLV's are specified in SMPTE&336M and are 16-bytes long.

  The byte order of the KLV data value is the same as the byte order of the byte buffer passed to initialize or set the value.

  See Also:
    `KLVDataDefinition`, `Component.getComponentKLVData()`, `Package.getPackageKLVData()`, `TypeDefinitionOpaque`, `TypeDefinitions.KLVDataStrongReference`, `TypeDefinitions.KLVDataStrongReferenceVector`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `KLVData` | `clone()` Create a cloned copy of this KLV data value.
    `AUID` | `getKey()` Returns the key of this KLV data.
    `int` | `getLength()` Returns the size of the data buffer for this KLV data, which includes the key.
    `ByteBuffer` | `getValue()` Returns the value of this KLV data, including the key.
    `void` | `setValue(ByteBuffer klvDataValue)` Sets the key and data value of the KLV data from the given byte array.

    - ### Methods inherited from interface tv.amwa.maj.model.InterchangeObject

      `addApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toString`

    - ### Methods inherited from interface tv.amwa.maj.industry.MediaEntity

      `getPersistentID, setPersistentIndex`

- - ### Method Detail

    - #### getKey

          AUID getKey()

      Returns the key of this KLV data.

      Returns:
        Key of the KLV data.

    - #### getValue

          @DataBuffer
          ByteBuffer getValue()

      Returns the value of this KLV data, including the key.

      Returns:
        Value of the KLV data.

    - #### getLength

          @UInt32
          int getLength()

      Returns the size of the data buffer for this KLV data, which includes the key.

      Returns:
        Length of the value of the KLV data.

    - #### setValue

          void setValue(@DataBuffer
                        ByteBuffer klvDataValue)
                 throws NullPointerException,
                        IllegalArgumentException

      Sets the key and data value of the KLV data from the given byte array. The key is assumed to be the first 16 bytes of the value.

      Parameters:
        `klvDataValue` - Value to set for the KLV data.
      Throws:
        `NullPointerException` - The given buffer for the data value is `null`.
        `IllegalArgumentException` - A buffer is too short. It must contain a key of of 16-bytes.

    - #### clone

          KLVData clone()

      Create a cloned copy of this KLV data value.

      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `MediaEntity`
      Returns:
        Cloned copy of this KLV data value.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.