Class ServletServerStream.ByteArrayWritableBuffer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) byte[] bytes  
      private int capacity  
      private int index  
    • Method Summary

      All Methods Instance Methods Concrete 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.
      • Methods inherited from class java.lang.Object

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

      • capacity

        private final int capacity
      • bytes

        final byte[] bytes
      • index

        private int index
    • Constructor Detail

      • ByteArrayWritableBuffer

        ByteArrayWritableBuffer​(int capacityHint)
    • 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