RealBufferedSource$1.smali 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. .class Lokio/RealBufferedSource$1;
  2. .super Ljava/io/InputStream;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingMethod;
  6. value = Lokio/RealBufferedSource;->inputStream()Ljava/io/InputStream;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x0
  10. name = null
  11. .end annotation
  12. # instance fields
  13. .field final synthetic this$0:Lokio/RealBufferedSource;
  14. # direct methods
  15. .method constructor <init>(Lokio/RealBufferedSource;)V
  16. .locals 0
  17. iput-object p1, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  18. invoke-direct {p0}, Ljava/io/InputStream;-><init>()V
  19. return-void
  20. .end method
  21. # virtual methods
  22. .method public available()I
  23. .locals 4
  24. .annotation system Ldalvik/annotation/Throws;
  25. value = {
  26. Ljava/io/IOException;
  27. }
  28. .end annotation
  29. iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  30. iget-boolean v1, v0, Lokio/RealBufferedSource;->closed:Z
  31. if-nez v1, :cond_0
  32. iget-object v0, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  33. iget-wide v0, v0, Lokio/Buffer;->size:J
  34. const-wide/32 v2, 0x7fffffff
  35. invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->min(JJ)J
  36. move-result-wide v0
  37. long-to-int v1, v0
  38. return v1
  39. :cond_0
  40. new-instance v0, Ljava/io/IOException;
  41. const-string v1, "closed"
  42. invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  43. throw v0
  44. .end method
  45. .method public close()V
  46. .locals 1
  47. .annotation system Ldalvik/annotation/Throws;
  48. value = {
  49. Ljava/io/IOException;
  50. }
  51. .end annotation
  52. iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  53. invoke-virtual {v0}, Lokio/RealBufferedSource;->close()V
  54. return-void
  55. .end method
  56. .method public read()I
  57. .locals 7
  58. .annotation system Ldalvik/annotation/Throws;
  59. value = {
  60. Ljava/io/IOException;
  61. }
  62. .end annotation
  63. iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  64. iget-boolean v1, v0, Lokio/RealBufferedSource;->closed:Z
  65. if-nez v1, :cond_1
  66. iget-object v1, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  67. iget-wide v2, v1, Lokio/Buffer;->size:J
  68. const-wide/16 v4, 0x0
  69. cmp-long v6, v2, v4
  70. if-nez v6, :cond_0
  71. iget-object v0, v0, Lokio/RealBufferedSource;->source:Lokio/Source;
  72. const-wide/16 v2, 0x2000
  73. invoke-interface {v0, v1, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
  74. move-result-wide v0
  75. const-wide/16 v2, -0x1
  76. cmp-long v4, v0, v2
  77. if-nez v4, :cond_0
  78. const/4 v0, -0x1
  79. return v0
  80. :cond_0
  81. iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  82. iget-object v0, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  83. invoke-virtual {v0}, Lokio/Buffer;->readByte()B
  84. move-result v0
  85. and-int/lit16 v0, v0, 0xff
  86. return v0
  87. :cond_1
  88. new-instance v0, Ljava/io/IOException;
  89. const-string v1, "closed"
  90. invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  91. throw v0
  92. .end method
  93. .method public read([BII)I
  94. .locals 7
  95. .annotation system Ldalvik/annotation/Throws;
  96. value = {
  97. Ljava/io/IOException;
  98. }
  99. .end annotation
  100. iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  101. iget-boolean v0, v0, Lokio/RealBufferedSource;->closed:Z
  102. if-nez v0, :cond_1
  103. array-length v0, p1
  104. int-to-long v1, v0
  105. int-to-long v3, p2
  106. int-to-long v5, p3
  107. invoke-static/range {v1 .. v6}, Lokio/Util;->checkOffsetAndCount(JJJ)V
  108. iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  109. iget-object v1, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  110. iget-wide v2, v1, Lokio/Buffer;->size:J
  111. const-wide/16 v4, 0x0
  112. cmp-long v6, v2, v4
  113. if-nez v6, :cond_0
  114. iget-object v0, v0, Lokio/RealBufferedSource;->source:Lokio/Source;
  115. const-wide/16 v2, 0x2000
  116. invoke-interface {v0, v1, v2, v3}, Lokio/Source;->read(Lokio/Buffer;J)J
  117. move-result-wide v0
  118. const-wide/16 v2, -0x1
  119. cmp-long v4, v0, v2
  120. if-nez v4, :cond_0
  121. const/4 p1, -0x1
  122. return p1
  123. :cond_0
  124. iget-object v0, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  125. iget-object v0, v0, Lokio/RealBufferedSource;->buffer:Lokio/Buffer;
  126. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->read([BII)I
  127. move-result p1
  128. return p1
  129. :cond_1
  130. new-instance p1, Ljava/io/IOException;
  131. const-string p2, "closed"
  132. invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  133. throw p1
  134. .end method
  135. .method public toString()Ljava/lang/String;
  136. .locals 2
  137. new-instance v0, Ljava/lang/StringBuilder;
  138. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  139. iget-object v1, p0, Lokio/RealBufferedSource$1;->this$0:Lokio/RealBufferedSource;
  140. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  141. const-string v1, ".inputStream()"
  142. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  143. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  144. move-result-object v0
  145. return-object v0
  146. .end method