Interface WritableBuffer

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
    • Method Detail

      • write

        void write​(byte[] src,
                   int srcIndex,
                   int length)
        Appends length bytes to the buffer from the source array starting at srcIndex.
        Throws:
        java.lang.IndexOutOfBoundsException - if the specified srcIndex is less than 0, if srcIndex + length is greater than src.length, or if length is greater than writableBytes()
      • write

        void write​(byte b)
        Appends a single byte to the buffer. This is slow so don't call it.
      • writableBytes

        int writableBytes()
        Returns the number of bytes one can write to the buffer.
      • readableBytes

        int readableBytes()
        Returns the number of bytes one can read from the buffer.
      • release

        void release()
        Releases the buffer, indicating to the WritableBufferAllocator that this buffer is no longer used and its resources can be reused.