public class GrpcSerializationUtils extends Object
Modifier and Type | Field and Description |
---|---|
static io.grpc.CallOptions.Key<io.grpc.MethodDescriptor> |
OVERRIDDEN_METHOD_DESCRIPTOR |
Constructor and Description |
---|
GrpcSerializationUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addBuffersToStream(io.netty.buffer.ByteBuf[] buffers,
OutputStream stream)
Add the given buffers directly to the gRPC output stream.
|
static io.grpc.internal.ReadableBuffer |
getBufferFromStream(InputStream stream)
Gets a buffer directly from a gRPC input stream.
|
static io.netty.buffer.ByteBuf |
getByteBufFromReadableBuffer(io.grpc.internal.ReadableBuffer buffer)
Gets a Netty buffer directly from a gRPC ReadableBuffer.
|
static int |
makeTag(int fieldNumber,
int wireType)
Makes a gRPC tag for a field.
|
static io.grpc.ServerServiceDefinition |
overrideMethods(io.grpc.ServerServiceDefinition service,
Map<io.grpc.MethodDescriptor,io.grpc.MethodDescriptor> marshallers)
Creates a service definition that uses custom marshallers.
|
public static final io.grpc.CallOptions.Key<io.grpc.MethodDescriptor> OVERRIDDEN_METHOD_DESCRIPTOR
public static int makeTag(int fieldNumber, int wireType)
fieldNumber
- field numberwireType
- wire type of the fieldpublic static io.grpc.internal.ReadableBuffer getBufferFromStream(InputStream stream)
stream
- the input streampublic static io.netty.buffer.ByteBuf getByteBufFromReadableBuffer(io.grpc.internal.ReadableBuffer buffer)
buffer
- the input bufferpublic static boolean addBuffersToStream(io.netty.buffer.ByteBuf[] buffers, OutputStream stream)
buffers
- the buffers to be addedstream
- the output streampublic static io.grpc.ServerServiceDefinition overrideMethods(io.grpc.ServerServiceDefinition service, Map<io.grpc.MethodDescriptor,io.grpc.MethodDescriptor> marshallers)
service
- the service to interceptmarshallers
- a map that specifies which marshaller to use for each methodCopyright © 2023. All Rights Reserved.