title: Netty UnpooledHeapByteBuf, strange and unjustified IndexOutOfBoundsException
body: <p>In rare occasion Netty throw this kind of exception:</p>
  
  <blockquote>
    <p>java.lang.IndexOutOfBoundsException: readerIndex(37) + length(2)
    exceeds writerIndex(185): UnpooledHeapByteBuf(ridx: 37, widx: 185,
    cap: 185/185)
            at io.netty.buffer.AbstractByteBuf.checkReadableBytes0(AbstractByteBuf.java:1405)
            at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1392)
            at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:872)
            at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:880)</p>
  </blockquote>
  
  <p>The code is :</p>
  
  <pre><code>private void checkReadableBytes0(int minimumReadableBytes) {
      ensureAccessible();
      if (readerIndex &gt; writerIndex - minimumReadableBytes) {
          throw new IndexOutOfBoundsException(String.format(
                  "readerIndex(%d) + length(%d) exceeds writerIndex(%d): %s",
                  readerIndex, minimumReadableBytes, writerIndex, this));
      }
  }
  </code></pre>
  
  <p>(37 > 185 - 2) should be true, how can it raise an exception ??</p>