docs: public final static int getScalarReadLengthFromBytes(byte[] bytes, int offset, int maxLength)
      {
          int src = offset;
          int end = offset + maxLength;
  
          if (src >= end) throw new ArrayIndexOutOfBoundsException();
          int c = bytes[src++] & 0xff;
          int utf8length = getUTF8LengthFromFirstByte(c);
          if (src + utf8length > end) throw new ArrayIndexOutOfBoundsException();
  
          return utf8length;
      }