-
public final class MetadataHelperHelper 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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMetadataHelper.ParcelableMetadataMarshallerA marshaller for passing parcelables in gRPC Metadata
-
Method Summary
Modifier and Type Method Description static voidwriteMetadata(Parcel parcel, @Nullable() Metadata metadata)Write a Metadata instance to a Parcel. static MetadatareadMetadata(Parcel parcel, Attributes attributes)Read a Metadata instance from a Parcel. -
-
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.
-
-
-
-