|
| 1 | +package jsoniter_codegen.cfg1173796797.decoder; |
| 2 | +public class int_array implements com.jsoniter.spi.Decoder { |
| 3 | +public static java.lang.Object decode_(com.jsoniter.JsonIterator iter) throws java.io.IOException { com.jsoniter.CodegenAccess.resetExistingObject(iter); |
| 4 | +byte nextToken = com.jsoniter.CodegenAccess.readByte(iter); |
| 5 | +if (nextToken != '[') { |
| 6 | +if (nextToken == 'n') { |
| 7 | +com.jsoniter.CodegenAccess.skipFixedBytes(iter, 3); |
| 8 | +com.jsoniter.CodegenAccess.resetExistingObject(iter); return null; |
| 9 | +} else { |
| 10 | +nextToken = com.jsoniter.CodegenAccess.nextToken(iter); |
| 11 | +if (nextToken == 'n') { |
| 12 | +com.jsoniter.CodegenAccess.skipFixedBytes(iter, 3); |
| 13 | +com.jsoniter.CodegenAccess.resetExistingObject(iter); return null; |
| 14 | +} |
| 15 | +} |
| 16 | +} |
| 17 | +nextToken = com.jsoniter.CodegenAccess.nextToken(iter); |
| 18 | +if (nextToken == ']') { |
| 19 | +return new int[0]; |
| 20 | +} |
| 21 | +com.jsoniter.CodegenAccess.unreadByte(iter); |
| 22 | +int a1 = (int)iter.readInt(); |
| 23 | +if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) { |
| 24 | +return new int[]{ a1 }; |
| 25 | +} |
| 26 | +int a2 = (int)iter.readInt(); |
| 27 | +if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) { |
| 28 | +return new int[]{ a1, a2 }; |
| 29 | +} |
| 30 | +int a3 = (int)iter.readInt(); |
| 31 | +if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) { |
| 32 | +return new int[]{ a1, a2, a3 }; |
| 33 | +} |
| 34 | +int a4 = (int) (int)iter.readInt(); |
| 35 | +if (!com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) { |
| 36 | +return new int[]{ a1, a2, a3, a4 }; |
| 37 | +} |
| 38 | +int a5 = (int) (int)iter.readInt(); |
| 39 | +int[] arr = new int[10]; |
| 40 | +arr[0] = a1; |
| 41 | +arr[1] = a2; |
| 42 | +arr[2] = a3; |
| 43 | +arr[3] = a4; |
| 44 | +arr[4] = a5; |
| 45 | +int i = 5; |
| 46 | +while (com.jsoniter.CodegenAccess.nextTokenIsComma(iter)) { |
| 47 | +if (i == arr.length) { |
| 48 | +int[] newArr = new int[arr.length * 2]; |
| 49 | +System.arraycopy(arr, 0, newArr, 0, arr.length); |
| 50 | +arr = newArr; |
| 51 | +} |
| 52 | +arr[i++] = (int)iter.readInt(); |
| 53 | +} |
| 54 | +int[] result = new int[i]; |
| 55 | +System.arraycopy(arr, 0, result, 0, i); |
| 56 | +return result; |
| 57 | +}public java.lang.Object decode(com.jsoniter.JsonIterator iter) throws java.io.IOException { |
| 58 | +return decode_(iter); |
| 59 | +} |
| 60 | +} |
0 commit comments