code: public int scanCStringLength() throws IOException {
      int pos = index;
      while (true) {
        while (pos < endIndex) {
          if (buffer[pos++] == '\0') {
            return pos - index;
          }
        }
        if (!readMore(STRING_SCAN_SPAN)) {
          throw new EOFException();
        }
        pos = index;
      }
    }
docs: Scans the length of the next null terminated string (C-style string) from the stream.
  
  @return The length of the next null terminated string.
  @throws IOException If reading of stream fails.
  @throws EOFException If the stream did not contain any null terminators.