forked from json-iterator/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodegenAccess.java
More file actions
35 lines (26 loc) · 1.27 KB
/
CodegenAccess.java
File metadata and controls
35 lines (26 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.jsoniter;
import java.io.IOException;
// only uesd by generated code to access decoder
public class CodegenAccess {
public static final boolean readBoolean(String cacheKey, Jsoniter iter) throws IOException {
return Codegen.getBooleanDecoder(cacheKey).decodeBoolean(iter);
}
public static final short readShort(String cacheKey, Jsoniter iter) throws IOException {
return Codegen.getShortDecoder(cacheKey).decodeShort(iter);
}
public static final int readInt(String cacheKey, Jsoniter iter) throws IOException {
return Codegen.getIntDecoder(cacheKey).decodeInt(iter);
}
public static final long readLong(String cacheKey, Jsoniter iter) throws IOException {
return Codegen.getLongDecoder(cacheKey).decodeLong(iter);
}
public static final float readFloat(String cacheKey, Jsoniter iter) throws IOException {
return Codegen.getFloatDecoder(cacheKey).decodeFloat(iter);
}
public static final double readDouble(String cacheKey, Jsoniter iter) throws IOException {
return Codegen.getDoubleDecoder(cacheKey).decodeDouble(iter);
}
public static final <T> T read(String cacheKey, Jsoniter iter) throws IOException {
return (T) Codegen.getDecoder(cacheKey, null).decode(iter);
}
}