JsonWriter.smali
31.3 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
.class public Lcom/google/gson/stream/JsonWriter;
.super Ljava/lang/Object;
.source "JsonWriter.java"
# interfaces
.implements Ljava/io/Closeable;
.implements Ljava/io/Flushable;
# static fields
.field private static final HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
.field private static final REPLACEMENT_CHARS:[Ljava/lang/String;
# instance fields
.field private deferredName:Ljava/lang/String;
.field private htmlSafe:Z
.field private indent:Ljava/lang/String;
.field private lenient:Z
.field private final out:Ljava/io/Writer;
.field private separator:Ljava/lang/String;
.field private serializeNulls:Z
.field private stack:[I
.field private stackSize:I
# direct methods
.method static constructor <clinit>()V
.locals 5
const/16 v0, 0x80
.line 145
new-array v0, v0, [Ljava/lang/String;
sput-object v0, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
const/4 v0, 0x0
move v1, v0
:goto_0
const/16 v2, 0x1f
if-gt v1, v2, :cond_0
.line 147
sget-object v2, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
const/4 v3, 0x1
new-array v3, v3, [Ljava/lang/Object;
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v4
aput-object v4, v3, v0
const-string v4, "\\u%04x"
invoke-static {v4, v3}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object v3
aput-object v3, v2, v1
add-int/lit8 v1, v1, 0x1
goto :goto_0
.line 149
:cond_0
sget-object v0, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
const/16 v1, 0x22
const-string v2, "\\\""
aput-object v2, v0, v1
const/16 v1, 0x5c
const-string v2, "\\\\"
.line 150
aput-object v2, v0, v1
const/16 v1, 0x9
const-string v2, "\\t"
.line 151
aput-object v2, v0, v1
const/16 v1, 0x8
const-string v2, "\\b"
.line 152
aput-object v2, v0, v1
const/16 v1, 0xa
const-string v2, "\\n"
.line 153
aput-object v2, v0, v1
const/16 v1, 0xd
const-string v2, "\\r"
.line 154
aput-object v2, v0, v1
const/16 v1, 0xc
const-string v2, "\\f"
.line 155
aput-object v2, v0, v1
.line 156
invoke-virtual {v0}, [Ljava/lang/String;->clone()Ljava/lang/Object;
move-result-object v0
check-cast v0, [Ljava/lang/String;
sput-object v0, Lcom/google/gson/stream/JsonWriter;->HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
.line 157
sget-object v0, Lcom/google/gson/stream/JsonWriter;->HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
const/16 v1, 0x3c
const-string v2, "\\u003c"
aput-object v2, v0, v1
const/16 v1, 0x3e
const-string v2, "\\u003e"
.line 158
aput-object v2, v0, v1
const/16 v1, 0x26
const-string v2, "\\u0026"
.line 159
aput-object v2, v0, v1
const/16 v1, 0x3d
const-string v2, "\\u003d"
.line 160
aput-object v2, v0, v1
const/16 v1, 0x27
const-string v2, "\\u0027"
.line 161
aput-object v2, v0, v1
return-void
.end method
.method public constructor <init>(Ljava/io/Writer;)V
.locals 1
.line 197
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/16 v0, 0x20
.line 167
new-array v0, v0, [I
iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
const/4 v0, 0x0
.line 168
iput v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
const/4 v0, 0x6
.line 170
invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->push(I)V
const-string v0, ":"
.line 182
iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->separator:Ljava/lang/String;
const/4 v0, 0x1
.line 190
iput-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
if-eqz p1, :cond_0
.line 201
iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
return-void
.line 199
:cond_0
new-instance p1, Ljava/lang/NullPointerException;
const-string v0, "out == null"
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method private beforeName()V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 612
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->peek()I
move-result v0
const/4 v1, 0x5
if-ne v0, v1, :cond_0
.line 614
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
const/16 v1, 0x2c
invoke-virtual {v0, v1}, Ljava/io/Writer;->write(I)V
goto :goto_0
:cond_0
const/4 v1, 0x3
if-ne v0, v1, :cond_1
.line 618
:goto_0
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->newline()V
const/4 v0, 0x4
.line 619
invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
return-void
.line 616
:cond_1
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Nesting problem."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method private beforeValue()V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 629
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->peek()I
move-result v0
const/4 v1, 0x1
const/4 v2, 0x2
if-eq v0, v1, :cond_5
if-eq v0, v2, :cond_4
const/4 v1, 0x4
if-eq v0, v1, :cond_3
const/4 v1, 0x6
const/4 v2, 0x7
if-eq v0, v1, :cond_2
if-ne v0, v2, :cond_1
.line 631
iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
if-eqz v0, :cond_0
goto :goto_0
.line 632
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "JSON must have only one top-level value."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.line 656
:cond_1
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Nesting problem."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.line 637
:cond_2
:goto_0
invoke-direct {p0, v2}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
goto :goto_1
.line 651
:cond_3
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->separator:Ljava/lang/String;
invoke-virtual {v0, v1}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
const/4 v0, 0x5
.line 652
invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
goto :goto_1
.line 646
:cond_4
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
const/16 v1, 0x2c
invoke-virtual {v0, v1}, Ljava/io/Writer;->append(C)Ljava/io/Writer;
.line 647
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->newline()V
goto :goto_1
.line 641
:cond_5
invoke-direct {p0, v2}, Lcom/google/gson/stream/JsonWriter;->replaceTop(I)V
.line 642
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->newline()V
:goto_1
return-void
.end method
.method private close(IILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 337
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->peek()I
move-result v0
if-eq v0, p2, :cond_1
if-ne v0, p1, :cond_0
goto :goto_0
.line 339
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string p2, "Nesting problem."
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.line 341
:cond_1
:goto_0
iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
if-nez p1, :cond_3
.line 345
iget p1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
add-int/lit8 p1, p1, -0x1
iput p1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
if-ne v0, p2, :cond_2
.line 347
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->newline()V
.line 349
:cond_2
iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {p1, p3}, Ljava/io/Writer;->write(Ljava/lang/String;)V
return-object p0
.line 342
:cond_3
new-instance p1, Ljava/lang/IllegalStateException;
new-instance p2, Ljava/lang/StringBuilder;
invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V
const-string p3, "Dangling name: "
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
iget-object p3, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p2
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method private newline()V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 597
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
if-nez v0, :cond_0
return-void
.line 601
:cond_0
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
const-string v1, "\n"
invoke-virtual {v0, v1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
.line 602
iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
const/4 v1, 0x1
:goto_0
if-ge v1, v0, :cond_1
.line 603
iget-object v2, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
iget-object v3, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/io/Writer;->write(Ljava/lang/String;)V
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_1
return-void
.end method
.method private open(ILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 325
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 326
invoke-direct {p0, p1}, Lcom/google/gson/stream/JsonWriter;->push(I)V
.line 327
iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {p1, p2}, Ljava/io/Writer;->write(Ljava/lang/String;)V
return-object p0
.end method
.method private peek()I
.locals 2
.line 366
iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
if-eqz v0, :cond_0
.line 369
iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
add-int/lit8 v0, v0, -0x1
aget v0, v1, v0
return v0
.line 367
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "JsonWriter is closed."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method private push(I)V
.locals 4
.line 354
iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
array-length v2, v1
if-ne v0, v2, :cond_0
mul-int/lit8 v2, v0, 0x2
.line 355
new-array v2, v2, [I
const/4 v3, 0x0
.line 356
invoke-static {v1, v3, v2, v3, v0}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V
.line 357
iput-object v2, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
.line 359
:cond_0
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
iget v1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
add-int/lit8 v2, v1, 0x1
iput v2, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
aput p1, v0, v1
return-void
.end method
.method private replaceTop(I)V
.locals 2
.line 376
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
iget v1, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
add-int/lit8 v1, v1, -0x1
aput p1, v0, v1
return-void
.end method
.method private string(Ljava/lang/String;)V
.locals 8
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 565
iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->htmlSafe:Z
if-eqz v0, :cond_0
sget-object v0, Lcom/google/gson/stream/JsonWriter;->HTML_SAFE_REPLACEMENT_CHARS:[Ljava/lang/String;
goto :goto_0
:cond_0
sget-object v0, Lcom/google/gson/stream/JsonWriter;->REPLACEMENT_CHARS:[Ljava/lang/String;
.line 566
:goto_0
iget-object v1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
const-string v2, "\""
invoke-virtual {v1, v2}, Ljava/io/Writer;->write(Ljava/lang/String;)V
.line 568
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v1
const/4 v3, 0x0
move v4, v3
:goto_1
if-ge v3, v1, :cond_6
.line 570
invoke-virtual {p1, v3}, Ljava/lang/String;->charAt(I)C
move-result v5
const/16 v6, 0x80
if-ge v5, v6, :cond_1
.line 573
aget-object v5, v0, v5
if-nez v5, :cond_3
goto :goto_3
:cond_1
const/16 v6, 0x2028
if-ne v5, v6, :cond_2
const-string v5, "\\u2028"
goto :goto_2
:cond_2
const/16 v6, 0x2029
if-ne v5, v6, :cond_5
const-string v5, "\\u2029"
:cond_3
:goto_2
if-ge v4, v3, :cond_4
.line 585
iget-object v6, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
sub-int v7, v3, v4
invoke-virtual {v6, p1, v4, v7}, Ljava/io/Writer;->write(Ljava/lang/String;II)V
.line 587
:cond_4
iget-object v4, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {v4, v5}, Ljava/io/Writer;->write(Ljava/lang/String;)V
add-int/lit8 v4, v3, 0x1
:cond_5
:goto_3
add-int/lit8 v3, v3, 0x1
goto :goto_1
:cond_6
if-ge v4, v1, :cond_7
.line 591
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
sub-int/2addr v1, v4
invoke-virtual {v0, p1, v4, v1}, Ljava/io/Writer;->write(Ljava/lang/String;II)V
.line 593
:cond_7
iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {p1, v2}, Ljava/io/Writer;->write(Ljava/lang/String;)V
return-void
.end method
.method private writeDeferredName()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 400
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
if-eqz v0, :cond_0
.line 401
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeName()V
.line 402
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
invoke-direct {p0, v0}, Lcom/google/gson/stream/JsonWriter;->string(Ljava/lang/String;)V
const/4 v0, 0x0
.line 403
iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
:cond_0
return-void
.end method
# virtual methods
.method public beginArray()Lcom/google/gson/stream/JsonWriter;
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 287
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
const/4 v0, 0x1
const-string v1, "["
.line 288
invoke-direct {p0, v0, v1}, Lcom/google/gson/stream/JsonWriter;->open(ILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
move-result-object v0
return-object v0
.end method
.method public beginObject()Lcom/google/gson/stream/JsonWriter;
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 307
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
const/4 v0, 0x3
const-string v1, "{"
.line 308
invoke-direct {p0, v0, v1}, Lcom/google/gson/stream/JsonWriter;->open(ILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
move-result-object v0
return-object v0
.end method
.method public close()V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 555
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {v0}, Ljava/io/Writer;->close()V
.line 557
iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
const/4 v1, 0x1
if-gt v0, v1, :cond_1
if-ne v0, v1, :cond_0
.line 558
iget-object v2, p0, Lcom/google/gson/stream/JsonWriter;->stack:[I
sub-int/2addr v0, v1
aget v0, v2, v0
const/4 v1, 0x7
if-ne v0, v1, :cond_1
:cond_0
const/4 v0, 0x0
.line 561
iput v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
return-void
.line 559
:cond_1
new-instance v0, Ljava/io/IOException;
const-string v1, "Incomplete document"
invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public endArray()Lcom/google/gson/stream/JsonWriter;
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/4 v0, 0x1
const/4 v1, 0x2
const-string v2, "]"
.line 297
invoke-direct {p0, v0, v1, v2}, Lcom/google/gson/stream/JsonWriter;->close(IILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
move-result-object v0
return-object v0
.end method
.method public endObject()Lcom/google/gson/stream/JsonWriter;
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const/4 v0, 0x3
const/4 v1, 0x5
const-string v2, "}"
.line 317
invoke-direct {p0, v0, v1, v2}, Lcom/google/gson/stream/JsonWriter;->close(IILjava/lang/String;)Lcom/google/gson/stream/JsonWriter;
move-result-object v0
return-object v0
.end method
.method public flush()V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 543
iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
if-eqz v0, :cond_0
.line 546
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {v0}, Ljava/io/Writer;->flush()V
return-void
.line 544
:cond_0
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "JsonWriter is closed."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public final getSerializeNulls()Z
.locals 1
.line 277
iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
return v0
.end method
.method public final isHtmlSafe()Z
.locals 1
.line 261
iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->htmlSafe:Z
return v0
.end method
.method public isLenient()Z
.locals 1
.line 242
iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
return v0
.end method
.method public jsonValue(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-nez p1, :cond_0
.line 432
invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
move-result-object p1
return-object p1
.line 434
:cond_0
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
.line 435
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 436
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {v0, p1}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
return-object p0
.end method
.method public name(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-eqz p1, :cond_2
.line 389
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
if-nez v0, :cond_1
.line 392
iget v0, p0, Lcom/google/gson/stream/JsonWriter;->stackSize:I
if-eqz v0, :cond_0
.line 395
iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
return-object p0
.line 393
:cond_0
new-instance p1, Ljava/lang/IllegalStateException;
const-string v0, "JsonWriter is closed."
invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p1
.line 390
:cond_1
new-instance p1, Ljava/lang/IllegalStateException;
invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
throw p1
.line 387
:cond_2
new-instance p1, Ljava/lang/NullPointerException;
const-string v0, "name == null"
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public nullValue()Lcom/google/gson/stream/JsonWriter;
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 446
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
if-eqz v0, :cond_1
.line 447
iget-boolean v0, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
if-eqz v0, :cond_0
.line 448
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
goto :goto_0
:cond_0
const/4 v0, 0x0
.line 450
iput-object v0, p0, Lcom/google/gson/stream/JsonWriter;->deferredName:Ljava/lang/String;
return-object p0
.line 454
:cond_1
:goto_0
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 455
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
const-string v1, "null"
invoke-virtual {v0, v1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
return-object p0
.end method
.method public final setHtmlSafe(Z)V
.locals 0
.line 253
iput-boolean p1, p0, Lcom/google/gson/stream/JsonWriter;->htmlSafe:Z
return-void
.end method
.method public final setIndent(Ljava/lang/String;)V
.locals 1
.line 213
invoke-virtual {p1}, Ljava/lang/String;->length()I
move-result v0
if-nez v0, :cond_0
const/4 p1, 0x0
.line 214
iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
const-string p1, ":"
.line 215
iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->separator:Ljava/lang/String;
goto :goto_0
.line 217
:cond_0
iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->indent:Ljava/lang/String;
const-string p1, ": "
.line 218
iput-object p1, p0, Lcom/google/gson/stream/JsonWriter;->separator:Ljava/lang/String;
:goto_0
return-void
.end method
.method public final setLenient(Z)V
.locals 0
.line 235
iput-boolean p1, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
return-void
.end method
.method public final setSerializeNulls(Z)V
.locals 0
.line 269
iput-boolean p1, p0, Lcom/google/gson/stream/JsonWriter;->serializeNulls:Z
return-void
.end method
.method public value(D)Lcom/google/gson/stream/JsonWriter;
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 494
invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z
move-result v0
if-nez v0, :cond_0
invoke-static {p1, p2}, Ljava/lang/Double;->isInfinite(D)Z
move-result v0
if-nez v0, :cond_0
.line 497
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
.line 498
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 499
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-static {p1, p2}, Ljava/lang/Double;->toString(D)Ljava/lang/String;
move-result-object p1
invoke-virtual {v0, p1}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
return-object p0
.line 495
:cond_0
new-instance v0, Ljava/lang/IllegalArgumentException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Numeric values must be finite, but was "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public value(J)Lcom/google/gson/stream/JsonWriter;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 509
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
.line 510
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 511
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-static {p1, p2}, Ljava/lang/Long;->toString(J)Ljava/lang/String;
move-result-object p1
invoke-virtual {v0, p1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
return-object p0
.end method
.method public value(Ljava/lang/Boolean;)Lcom/google/gson/stream/JsonWriter;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-nez p1, :cond_0
.line 478
invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
move-result-object p1
return-object p1
.line 480
:cond_0
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
.line 481
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 482
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {p1}, Ljava/lang/Boolean;->booleanValue()Z
move-result p1
if-eqz p1, :cond_1
const-string p1, "true"
goto :goto_0
:cond_1
const-string p1, "false"
:goto_0
invoke-virtual {v0, p1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
return-object p0
.end method
.method public value(Ljava/lang/Number;)Lcom/google/gson/stream/JsonWriter;
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-nez p1, :cond_0
.line 524
invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
move-result-object p1
return-object p1
.line 527
:cond_0
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
.line 528
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
.line 529
iget-boolean v1, p0, Lcom/google/gson/stream/JsonWriter;->lenient:Z
if-nez v1, :cond_2
const-string v1, "-Infinity"
.line 530
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_1
const-string v1, "Infinity"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_1
const-string v1, "NaN"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-nez v1, :cond_1
goto :goto_0
.line 531
:cond_1
new-instance v0, Ljava/lang/IllegalArgumentException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Numeric values must be finite, but was "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
.line 533
:cond_2
:goto_0
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 534
iget-object p1, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
invoke-virtual {p1, v0}, Ljava/io/Writer;->append(Ljava/lang/CharSequence;)Ljava/io/Writer;
return-object p0
.end method
.method public value(Ljava/lang/String;)Lcom/google/gson/stream/JsonWriter;
.locals 0
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
if-nez p1, :cond_0
.line 415
invoke-virtual {p0}, Lcom/google/gson/stream/JsonWriter;->nullValue()Lcom/google/gson/stream/JsonWriter;
move-result-object p1
return-object p1
.line 417
:cond_0
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
.line 418
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 419
invoke-direct {p0, p1}, Lcom/google/gson/stream/JsonWriter;->string(Ljava/lang/String;)V
return-object p0
.end method
.method public value(Z)Lcom/google/gson/stream/JsonWriter;
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
.line 465
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->writeDeferredName()V
.line 466
invoke-direct {p0}, Lcom/google/gson/stream/JsonWriter;->beforeValue()V
.line 467
iget-object v0, p0, Lcom/google/gson/stream/JsonWriter;->out:Ljava/io/Writer;
if-eqz p1, :cond_0
const-string p1, "true"
goto :goto_0
:cond_0
const-string p1, "false"
:goto_0
invoke-virtual {v0, p1}, Ljava/io/Writer;->write(Ljava/lang/String;)V
return-object p0
.end method