Streams.smali 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. .class public final Lcom/google/gson/internal/Streams;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/MemberClasses;
  6. value = {
  7. Lcom/google/gson/internal/Streams$AppendableWriter;
  8. }
  9. .end annotation
  10. # direct methods
  11. .method private constructor <init>()V
  12. .locals 1
  13. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  14. new-instance v0, Ljava/lang/UnsupportedOperationException;
  15. invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
  16. throw v0
  17. .end method
  18. .method public static parse(Lcom/google/gson/stream/JsonReader;)Lcom/google/gson/JsonElement;
  19. .locals 2
  20. .annotation system Ldalvik/annotation/Throws;
  21. value = {
  22. Lcom/google/gson/JsonParseException;
  23. }
  24. .end annotation
  25. :try_start_0
  26. invoke-virtual {p0}, Lcom/google/gson/stream/JsonReader;->peek()Lcom/google/gson/stream/JsonToken;
  27. :try_end_0
  28. .catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_4
  29. .catch Lcom/google/gson/stream/MalformedJsonException; {:try_start_0 .. :try_end_0} :catch_3
  30. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_2
  31. .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_1
  32. const/4 v0, 0x0
  33. :try_start_1
  34. sget-object v1, Lcom/google/gson/internal/bind/TypeAdapters;->JSON_ELEMENT:Lcom/google/gson/TypeAdapter;
  35. invoke-virtual {v1, p0}, Lcom/google/gson/TypeAdapter;->read(Lcom/google/gson/stream/JsonReader;)Ljava/lang/Object;
  36. move-result-object p0
  37. check-cast p0, Lcom/google/gson/JsonElement;
  38. :try_end_1
  39. .catch Ljava/io/EOFException; {:try_start_1 .. :try_end_1} :catch_0
  40. .catch Lcom/google/gson/stream/MalformedJsonException; {:try_start_1 .. :try_end_1} :catch_3
  41. .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_2
  42. .catch Ljava/lang/NumberFormatException; {:try_start_1 .. :try_end_1} :catch_1
  43. return-object p0
  44. :catch_0
  45. move-exception p0
  46. goto :goto_0
  47. :catch_1
  48. move-exception p0
  49. new-instance v0, Lcom/google/gson/JsonSyntaxException;
  50. invoke-direct {v0, p0}, Lcom/google/gson/JsonSyntaxException;-><init>(Ljava/lang/Throwable;)V
  51. throw v0
  52. :catch_2
  53. move-exception p0
  54. new-instance v0, Lcom/google/gson/JsonIOException;
  55. invoke-direct {v0, p0}, Lcom/google/gson/JsonIOException;-><init>(Ljava/lang/Throwable;)V
  56. throw v0
  57. :catch_3
  58. move-exception p0
  59. new-instance v0, Lcom/google/gson/JsonSyntaxException;
  60. invoke-direct {v0, p0}, Lcom/google/gson/JsonSyntaxException;-><init>(Ljava/lang/Throwable;)V
  61. throw v0
  62. :catch_4
  63. move-exception p0
  64. const/4 v0, 0x1
  65. :goto_0
  66. if-eqz v0, :cond_0
  67. sget-object p0, Lcom/google/gson/JsonNull;->INSTANCE:Lcom/google/gson/JsonNull;
  68. return-object p0
  69. :cond_0
  70. new-instance v0, Lcom/google/gson/JsonSyntaxException;
  71. invoke-direct {v0, p0}, Lcom/google/gson/JsonSyntaxException;-><init>(Ljava/lang/Throwable;)V
  72. throw v0
  73. .end method
  74. .method public static write(Lcom/google/gson/JsonElement;Lcom/google/gson/stream/JsonWriter;)V
  75. .locals 1
  76. .annotation system Ldalvik/annotation/Throws;
  77. value = {
  78. Ljava/io/IOException;
  79. }
  80. .end annotation
  81. sget-object v0, Lcom/google/gson/internal/bind/TypeAdapters;->JSON_ELEMENT:Lcom/google/gson/TypeAdapter;
  82. invoke-virtual {v0, p1, p0}, Lcom/google/gson/TypeAdapter;->write(Lcom/google/gson/stream/JsonWriter;Ljava/lang/Object;)V
  83. return-void
  84. .end method
  85. .method public static writerForAppendable(Ljava/lang/Appendable;)Ljava/io/Writer;
  86. .locals 1
  87. instance-of v0, p0, Ljava/io/Writer;
  88. if-eqz v0, :cond_0
  89. check-cast p0, Ljava/io/Writer;
  90. goto :goto_0
  91. :cond_0
  92. new-instance v0, Lcom/google/gson/internal/Streams$AppendableWriter;
  93. invoke-direct {v0, p0}, Lcom/google/gson/internal/Streams$AppendableWriter;-><init>(Ljava/lang/Appendable;)V
  94. move-object p0, v0
  95. :goto_0
  96. return-object p0
  97. .end method