This actually should be 'readerIndex'.  The previous section about readable bytes should indeed use 'writerIndex'.  Thanks for a hint.