code: @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1712")
    public static ServerServiceDefinition useInputStreamMessages(
        final ServerServiceDefinition serviceDef) {
      final MethodDescriptor.Marshaller<InputStream> marshaller =
          new MethodDescriptor.Marshaller<InputStream>() {
        @Override
        public InputStream stream(final InputStream value) {
          return value;
        }
  
        @Override
        public InputStream parse(final InputStream stream) {
          if (stream.markSupported()) {
            return stream;
          } else {
            return new BufferedInputStream(stream);
          }
        }
      };
  
      return useMarshalledMessages(serviceDef, marshaller);
    }
docs: Create a new {@code ServerServiceDefinition} whose {@link MethodDescriptor} serializes to
  and from InputStream for all methods.  The InputStream is guaranteed return true for
  markSupported().  The {@code ServerCallHandler} created will automatically
  convert back to the original types for request and response before calling the existing
  {@code ServerCallHandler}.  Calling this method combined with the intercept methods will
  allow the developer to choose whether to intercept messages of InputStream, or the modeled
  types of their application.
  
  @param serviceDef the service definition to convert messages to InputStream
  @return a wrapped version of {@code serviceDef} with the InputStream conversion applied.