docs: public final static int getScalarFromBytes(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();
  
          switch (utf8length) {
          case 1:
              break;
          case 2:
              c  = (c & UNICODE_TWO_BYTE_MASK);
              c |= ((bytes[src++] & 0xff) & UNICODE_CONTINUATION_BYTE_MASK);
              break;
          case 3:
              c  = (c & UNICODE_THREE_BYTE_MASK);
              c |= ((bytes[src++] & 0xff) & UNICODE_CONTINUATION_BYTE_MASK);
              c |= ((bytes[src++] & 0xff) & UNICODE_CONTINUATION_BYTE_MASK);
              break;
          case 4:
              c  = (c & UNICODE_FOUR_BYTE_MASK);
              c |= ((bytes[src++] & 0xff) & UNICODE_CONTINUATION_BYTE_MASK);
              c |= ((bytes[src++] & 0xff) & UNICODE_CONTINUATION_BYTE_MASK);
              c |= ((bytes[src++] & 0xff) & UNICODE_CONTINUATION_BYTE_MASK);
              break;
          default:
              throw new InvalidUnicodeCodePoint("code point is invalid: "+utf8length);
          }
          return c;
      }