public O deserializeResponse(DeframedMessage message, boolean grpcWebText) throws IOException {
        InputStream messageStream = message.stream();
        final ByteBuf buf = message.buf();
        if (buf != null) {
            try {
                switch (responseType) {
                    case PROTOBUF:
                        final PrototypeMarshaller<O> marshaller =
                                (PrototypeMarshaller<O>) method.getResponseMarshaller();
                        // PrototypeMarshaller<I>.getMessagePrototype will always parse to I
                        @SuppressWarnings("unchecked")
                        final O msg = (O) deserializeProto(marshaller, buf);
                        return msg;
                    default:
                        // Fallback to using the method's stream marshaller.
                        messageStream = new ByteBufInputStream(buf.retain(), true);
                        break;
                }
            } finally {
                if (!unsafeWrapDeserializedBuffer || grpcWebText) {
                    buf.release();
                }
            }
        }

        assert messageStream != null;
        try (InputStream msg = messageStream) {
            if (isProto) {
                return method.parseResponse(msg);
            } else {
                assert jsonMarshaller != null;
                return jsonMarshaller.deserializeMessage(responseMarshaller, msg);
            }
        }
    }
Marshaller for gRPC method request or response messages to and from {@link ByteBuf}. Will attempt to use
optimized code paths for known message types, and otherwise delegates to the gRPC stub.
grpc/src/main/java/com/linecorp/armeria/internal/common/grpc/GrpcMessageMarshaller.java