code: private void reallocateBuffer(int newCapacity) {
  
          byte[] newBuffer = new byte[newCapacity];
          System.arraycopy(m_buffer, 0, newBuffer, 0, Math.min(m_size, newCapacity));
          m_buffer = newBuffer;
      }
docs: Reallocates the internal byte buffer with a new capacity.<p>
  
  @param newCapacity the new capacity