Class MarshalerInputStream

  • All Implemented Interfaces:
    io.grpc.Drainable, io.grpc.KnownLength, java.io.Closeable, java.lang.AutoCloseable

    public final class MarshalerInputStream
    extends java.io.InputStream
    implements io.grpc.Drainable, io.grpc.KnownLength
    Adapter from Marshaler to gRPC types.

    This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Marshaler message  
      private java.io.ByteArrayInputStream partial  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()  
      int drainTo​(java.io.OutputStream target)  
      int read()  
      int read​(byte[] b, int off, int len)  
      private static byte[] toByteArray​(Marshaler message)  
      • Methods inherited from class java.io.InputStream

        close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • message

        @Nullable
        private Marshaler message
      • partial

        @Nullable
        private java.io.ByteArrayInputStream partial
    • Method Detail

      • drainTo

        public int drainTo​(java.io.OutputStream target)
                    throws java.io.IOException
        Specified by:
        drainTo in interface io.grpc.Drainable
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • toByteArray

        private static byte[] toByteArray​(Marshaler message)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • available

        public int available()
        Specified by:
        available in interface io.grpc.KnownLength
        Overrides:
        available in class java.io.InputStream