Package 

Class MetadataHelper


  • 
    public final class MetadataHelper
    
                        

    Helper class for reading & writing metadata to parcels.

    Metadata is written to a parcel as a single int for the number of name/value pairs, followed by the following pattern for each pair.

    • name length (int)
    • name (byte[])
    • value length OR sentinel (int)
    • value (byte[] OR Parcelable)
    The sentinel int at the start of a value may indicate bad metadata. When this happens, no more data follows the sentinel.
    • Method Summary

      Modifier and Type Method Description
      static void writeMetadata(Parcel parcel, @Nullable() Metadata metadata) Write a Metadata instance to a Parcel.
      static Metadata readMetadata(Parcel parcel, Attributes attributes) Read a Metadata instance from a Parcel.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • writeMetadata

         static void writeMetadata(Parcel parcel, @Nullable() Metadata metadata)

        Write a Metadata instance to a Parcel.

        Parameters:
        parcel - The Parcel to write to.
        metadata - The Metadata to write.
      • readMetadata

         static Metadata readMetadata(Parcel parcel, Attributes attributes)

        Read a Metadata instance from a Parcel.

        Parameters:
        parcel - The Parcel to read from.