docs: private void fillBytesBuffer() throws IOException
    {
      // if last encoding result is underflow takes care to fill characters buffer
      if(!endOfInput && (lastEncoderResult == null || lastEncoderResult.isUnderflow())) {
        charactersBuffer.compact();
        int position = charactersBuffer.position();
        int readCount = reader.read(charactersBuffer.array(), position, charactersBuffer.remaining());
        if(readCount == EOF) {
          endOfInput = true;
        }
        else {
          charactersBuffer.position(position + readCount);
        }
        charactersBuffer.flip();
      }
  
      // get characters from reader buffer, encode them into bytes sequence and add to stream buffer
      bytesBuffer.compact();
      lastEncoderResult = encoder.encode(charactersBuffer, bytesBuffer, endOfInput);
      bytesBuffer.flip();
    }