-
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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
MetadataHelper.ParcelableMetadataMarshaller
A marshaller for passing parcelables in gRPC Metadata
-
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. -
-
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.
-
-
-
-