Exemplo n.º 1
0
  private int tryGetLength() {
    int lengthSize = SlimVersion.MINIMUM_NUMBER_LENGTH;
    String lengthString = serialized.substring(index, index + lengthSize);
    int length = Integer.parseInt(lengthString);
    index += lengthSize;

    Integer next;
    while ((next = maybeReadDigit()) != null) length = length * 10 + next;

    checkForColon("Length");
    return length;
  }
Exemplo n.º 2
0
 private String getString(int length) {
   String result = serialized.substring(index, index + length);
   index += length;
   checkForColon("String");
   return result;
 }