private static String readHugeStringFromDataInput(DataInput in) throws IOException {
    int len = in.readInt();
    char[] buf = new char[len];
    for (int i = 0; i < len; i++) {
      buf[i] = in.readChar();
    }
    return new String(buf);
  }
array len encoded as unsigned short in next 2 bytes

@since GemFire 5.7
geode-serialization/src/main/java/org/apache/geode/internal/serialization/StaticSerialization.java