AsyncTimeout$1.smali 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. .class Lokio/AsyncTimeout$1;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokio/Sink;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingMethod;
  8. value = Lokio/AsyncTimeout;->sink(Lokio/Sink;)Lokio/Sink;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x0
  12. name = null
  13. .end annotation
  14. # instance fields
  15. .field final synthetic this$0:Lokio/AsyncTimeout;
  16. .field final synthetic val$sink:Lokio/Sink;
  17. # direct methods
  18. .method constructor <init>(Lokio/AsyncTimeout;Lokio/Sink;)V
  19. .locals 0
  20. iput-object p1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  21. iput-object p2, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
  22. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  23. return-void
  24. .end method
  25. # virtual methods
  26. .method public close()V
  27. .locals 3
  28. .annotation system Ldalvik/annotation/Throws;
  29. value = {
  30. Ljava/io/IOException;
  31. }
  32. .end annotation
  33. iget-object v0, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  34. invoke-virtual {v0}, Lokio/AsyncTimeout;->enter()V
  35. :try_start_0
  36. iget-object v0, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
  37. invoke-interface {v0}, Lokio/Sink;->close()V
  38. :try_end_0
  39. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  40. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  41. const/4 v0, 0x1
  42. iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  43. invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Z)V
  44. return-void
  45. :catchall_0
  46. move-exception v0
  47. goto :goto_0
  48. :catch_0
  49. move-exception v0
  50. :try_start_1
  51. iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  52. invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
  53. move-result-object v0
  54. throw v0
  55. :try_end_1
  56. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  57. :goto_0
  58. iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  59. const/4 v2, 0x0
  60. invoke-virtual {v1, v2}, Lokio/AsyncTimeout;->exit(Z)V
  61. throw v0
  62. .end method
  63. .method public flush()V
  64. .locals 3
  65. .annotation system Ldalvik/annotation/Throws;
  66. value = {
  67. Ljava/io/IOException;
  68. }
  69. .end annotation
  70. iget-object v0, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  71. invoke-virtual {v0}, Lokio/AsyncTimeout;->enter()V
  72. :try_start_0
  73. iget-object v0, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
  74. invoke-interface {v0}, Lokio/Sink;->flush()V
  75. :try_end_0
  76. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  77. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  78. const/4 v0, 0x1
  79. iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  80. invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Z)V
  81. return-void
  82. :catchall_0
  83. move-exception v0
  84. goto :goto_0
  85. :catch_0
  86. move-exception v0
  87. :try_start_1
  88. iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  89. invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
  90. move-result-object v0
  91. throw v0
  92. :try_end_1
  93. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  94. :goto_0
  95. iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  96. const/4 v2, 0x0
  97. invoke-virtual {v1, v2}, Lokio/AsyncTimeout;->exit(Z)V
  98. throw v0
  99. .end method
  100. .method public timeout()Lokio/Timeout;
  101. .locals 1
  102. iget-object v0, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  103. return-object v0
  104. .end method
  105. .method public toString()Ljava/lang/String;
  106. .locals 2
  107. new-instance v0, Ljava/lang/StringBuilder;
  108. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  109. const-string v1, "AsyncTimeout.sink("
  110. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  111. iget-object v1, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
  112. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  113. const-string v1, ")"
  114. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  115. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  116. move-result-object v0
  117. return-object v0
  118. .end method
  119. .method public write(Lokio/Buffer;J)V
  120. .locals 6
  121. .annotation system Ldalvik/annotation/Throws;
  122. value = {
  123. Ljava/io/IOException;
  124. }
  125. .end annotation
  126. iget-wide v0, p1, Lokio/Buffer;->size:J
  127. const-wide/16 v2, 0x0
  128. move-wide v4, p2
  129. invoke-static/range {v0 .. v5}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  130. :goto_0
  131. const-wide/16 v0, 0x0
  132. cmp-long v2, p2, v0
  133. if-lez v2, :cond_2
  134. iget-object v2, p1, Lokio/Buffer;->head:Lokio/Segment;
  135. :goto_1
  136. const-wide/32 v3, 0x10000
  137. cmp-long v5, v0, v3
  138. if-gez v5, :cond_1
  139. iget-object v3, p1, Lokio/Buffer;->head:Lokio/Segment;
  140. iget v4, v3, Lokio/Segment;->limit:I
  141. iget v3, v3, Lokio/Segment;->pos:I
  142. sub-int/2addr v4, v3
  143. int-to-long v3, v4
  144. add-long/2addr v0, v3
  145. cmp-long v3, v0, p2
  146. if-ltz v3, :cond_0
  147. move-wide v0, p2
  148. goto :goto_2
  149. :cond_0
  150. iget-object v2, v2, Lokio/Segment;->next:Lokio/Segment;
  151. goto :goto_1
  152. :cond_1
  153. :goto_2
  154. const/4 v2, 0x0
  155. iget-object v3, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  156. invoke-virtual {v3}, Lokio/AsyncTimeout;->enter()V
  157. :try_start_0
  158. iget-object v3, p0, Lokio/AsyncTimeout$1;->val$sink:Lokio/Sink;
  159. invoke-interface {v3, p1, v0, v1}, Lokio/Sink;->write(Lokio/Buffer;J)V
  160. :try_end_0
  161. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  162. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  163. sub-long/2addr p2, v0
  164. const/4 v0, 0x1
  165. iget-object v1, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  166. invoke-virtual {v1, v0}, Lokio/AsyncTimeout;->exit(Z)V
  167. goto :goto_0
  168. :catchall_0
  169. move-exception p1
  170. goto :goto_3
  171. :catch_0
  172. move-exception p1
  173. :try_start_1
  174. iget-object p2, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  175. invoke-virtual {p2, p1}, Lokio/AsyncTimeout;->exit(Ljava/io/IOException;)Ljava/io/IOException;
  176. move-result-object p1
  177. throw p1
  178. :try_end_1
  179. .catchall {:try_start_1 .. :try_end_1} :catchall_0
  180. :goto_3
  181. iget-object p2, p0, Lokio/AsyncTimeout$1;->this$0:Lokio/AsyncTimeout;
  182. invoke-virtual {p2, v2}, Lokio/AsyncTimeout;->exit(Z)V
  183. throw p1
  184. :cond_2
  185. return-void
  186. .end method