Package io.grpc
Interface MethodDescriptor.Marshaller<T>
-
- Type Parameters:
T- type of serializable message
- All Known Subinterfaces:
MethodDescriptor.PrototypeMarshaller<T>,MethodDescriptor.ReflectableMarshaller<T>
- Enclosing class:
- MethodDescriptor<ReqT,RespT>
public static interface MethodDescriptor.Marshaller<T>A typed abstraction over message serialization and deserialization, a.k.a. marshalling and unmarshalling.Stub implementations will define implementations of this interface for each of the request and response messages provided by a service.
- Since:
- 1.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tparse(InputStream stream)Given anInputStreamparse it into an instance of the declared type so that it can be passed to application code.InputStreamstream(T value)Given a message, produce anInputStreamfor it so that it can be written to the wire.
-
-
-
Method Detail
-
stream
InputStream stream(T value)
Given a message, produce anInputStreamfor it so that it can be written to the wire. Where possible implementations should produce streams that areKnownLengthto improve transport efficiency.- Parameters:
value- to serialize.- Returns:
- serialized value as stream of bytes.
-
parse
T parse(InputStream stream)
Given anInputStreamparse it into an instance of the declared type so that it can be passed to application code.- Parameters:
stream- of bytes for serialized value- Returns:
- parsed value
-
-