
com.jsoniter.fuzzy.StringIntDecoder Maven / Gradle / Ivy
package com.jsoniter.fuzzy;
import com.jsoniter.CodegenAccess;
import com.jsoniter.JsonIterator;
import com.jsoniter.spi.Decoder;
import java.io.IOException;
public class StringIntDecoder extends Decoder.IntDecoder {
@Override
public int decodeInt(JsonIterator iter) throws IOException {
byte c = CodegenAccess.nextToken(iter);
if (c != '"') {
throw iter.reportError("StringIntDecoder", "expect \", but found: " + (char) c);
}
int val = iter.readInt();
c = CodegenAccess.nextToken(iter);
if (c != '"') {
throw iter.reportError("StringIntDecoder", "expect \", but found: " + (char) c);
}
return val;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy