Package io.grpc.netty

Class NettyWritableBuffer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private io.netty.buffer.ByteBuf bytebuf  
    • Constructor Summary

      Constructors 
      Constructor Description
      NettyWritableBuffer​(io.netty.buffer.ByteBuf bytebuf)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) io.netty.buffer.ByteBuf bytebuf()  
      int readableBytes()
      Returns the number of bytes one can read from the buffer.
      void release()
      Releases the buffer, indicating to the WritableBufferAllocator that this buffer is no longer used and its resources can be reused.
      int writableBytes()
      Returns the number of bytes one can write to the buffer.
      void write​(byte b)
      Appends a single byte to the buffer.
      void write​(byte[] src, int srcIndex, int length)
      Appends length bytes to the buffer from the source array starting at srcIndex.
      • Methods inherited from class java.lang.Object

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

      • bytebuf

        private final io.netty.buffer.ByteBuf bytebuf
    • Constructor Detail

      • NettyWritableBuffer

        NettyWritableBuffer​(io.netty.buffer.ByteBuf bytebuf)
    • Method Detail

      • write

        public void write​(byte[] src,
                          int srcIndex,
                          int length)
        Description copied from interface: WritableBuffer
        Appends length bytes to the buffer from the source array starting at srcIndex.
        Specified by:
        write in interface WritableBuffer
      • write

        public void write​(byte b)
        Description copied from interface: WritableBuffer
        Appends a single byte to the buffer. This is slow so don't call it.
        Specified by:
        write in interface WritableBuffer
      • writableBytes

        public int writableBytes()
        Description copied from interface: WritableBuffer
        Returns the number of bytes one can write to the buffer.
        Specified by:
        writableBytes in interface WritableBuffer
      • readableBytes

        public int readableBytes()
        Description copied from interface: WritableBuffer
        Returns the number of bytes one can read from the buffer.
        Specified by:
        readableBytes in interface WritableBuffer
      • bytebuf

        io.netty.buffer.ByteBuf bytebuf()