Package io.grpc

Class Metadata.LazyStreamBinaryKey<T>

  • Enclosing class:
    Metadata

    private static class Metadata.LazyStreamBinaryKey<T>
    extends Metadata.Key<T>
    A binary key for values which should be serialized lazily to InputStreams.
    • Constructor Detail

      • LazyStreamBinaryKey

        private LazyStreamBinaryKey​(java.lang.String name,
                                    Metadata.BinaryStreamMarshaller<T> marshaller)
        Keys have a name and a stream marshaller used for serialization.
    • Method Detail

      • toBytes

        byte[] toBytes​(T value)
        Description copied from class: Metadata.Key
        Serialize a metadata value to bytes.
        Specified by:
        toBytes in class Metadata.Key<T>
        Parameters:
        value - to serialize
        Returns:
        serialized version of value
      • parseBytes

        T parseBytes​(byte[] serialized)
        Description copied from class: Metadata.Key
        Parse a serialized metadata value from bytes.
        Specified by:
        parseBytes in class Metadata.Key<T>
        Parameters:
        serialized - value of metadata to parse
        Returns:
        a parsed instance of type T