com.jsoniter.fuzzy.StringLongDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsoniter Show documentation
Show all versions of jsoniter Show documentation
jsoniter (json-iterator) is fast and flexible JSON parser available in Java and Go
package com.jsoniter.fuzzy;
import com.jsoniter.CodegenAccess;
import com.jsoniter.JsonIterator;
import com.jsoniter.spi.Decoder;
import java.io.IOException;
public class StringLongDecoder extends Decoder.LongDecoder {
@Override
public long decodeLong(JsonIterator iter) throws IOException {
byte c = CodegenAccess.nextToken(iter);
if (c != '"') {
throw iter.reportError("StringLongDecoder", "expect \", but found: " + (char) c);
}
long val = iter.readLong();
c = CodegenAccess.nextToken(iter);
if (c != '"') {
throw iter.reportError("StringLongDecoder", "expect \", but found: " + (char) c);
}
return val;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy