code: private static int readLen16(ByteBuffer buffer) {
          int len = 0;
          int i = Buffers.readUShort(buffer);
          if ((i & 0x8000) != 0) {
              len |= (i & 0x7fff) << 16;
              len += Buffers.readUShort(buffer);
          } else {
              len = i;
          }
          return len;
      }
docs: read encoding len.
  see Stringpool.cpp ENCODE_LENGTH