code: private String readString(int strLen) {
          char[] chars = new char[strLen];
  
          for (int i = 0; i < strLen; i++) {
              short a = Buffers.readUByte(buffer);
              if ((a & 0x80) == 0) {
                  // ascii char
                  chars[i] = (char) a;
              } else if ((a & 0xe0) == 0xc0) {
                  // read one more
                  short b = Buffers.readUByte(buffer);
                  chars[i] = (char) (((a & 0x1F) << 6) | (b & 0x3F));
              } else if ((a & 0xf0) == 0xe0) {
                  short b = Buffers.readUByte(buffer);
                  short c = Buffers.readUByte(buffer);
                  chars[i] = (char) (((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F));
              } else if ((a & 0xf0) == 0xf0) {
                  //throw new UTFDataFormatException();
  
              } else {
                  //throw new UTFDataFormatException();
              }
              if (chars[i] == 0) {
                  // the end of string.
              }
          }
  
          return new String(chars);
      }
docs: read Modified UTF-8 encoding str.
  
  @param strLen the java-utf16-char len, not strLen nor bytes len.