Http2Reader$ContinuationSource.smali 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. .class final Lokhttp3/internal/http2/Http2Reader$ContinuationSource;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Lokio/Source;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingClass;
  8. value = Lokhttp3/internal/http2/Http2Reader;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x18
  12. name = "ContinuationSource"
  13. .end annotation
  14. # instance fields
  15. .field flags:B
  16. .field left:I
  17. .field length:I
  18. .field padding:S
  19. .field private final source:Lokio/BufferedSource;
  20. .field streamId:I
  21. # direct methods
  22. .method constructor <init>(Lokio/BufferedSource;)V
  23. .locals 0
  24. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  25. iput-object p1, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  26. return-void
  27. .end method
  28. .method private readContinuationHeader()V
  29. .locals 7
  30. .annotation system Ldalvik/annotation/Throws;
  31. value = {
  32. Ljava/io/IOException;
  33. }
  34. .end annotation
  35. iget v0, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->streamId:I
  36. iget-object v1, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  37. invoke-static {v1}, Lokhttp3/internal/http2/Http2Reader;->readMedium(Lokio/BufferedSource;)I
  38. move-result v1
  39. iput v1, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->left:I
  40. iput v1, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->length:I
  41. iget-object v1, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  42. invoke-interface {v1}, Lokio/BufferedSource;->readByte()B
  43. move-result v1
  44. and-int/lit16 v1, v1, 0xff
  45. int-to-byte v1, v1
  46. iget-object v2, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  47. invoke-interface {v2}, Lokio/BufferedSource;->readByte()B
  48. move-result v2
  49. and-int/lit16 v2, v2, 0xff
  50. int-to-byte v2, v2
  51. iput-byte v2, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->flags:B
  52. sget-object v2, Lokhttp3/internal/http2/Http2Reader;->logger:Ljava/util/logging/Logger;
  53. sget-object v3, Ljava/util/logging/Level;->FINE:Ljava/util/logging/Level;
  54. invoke-virtual {v2, v3}, Ljava/util/logging/Logger;->isLoggable(Ljava/util/logging/Level;)Z
  55. move-result v2
  56. const/4 v3, 0x1
  57. if-eqz v2, :cond_0
  58. sget-object v2, Lokhttp3/internal/http2/Http2Reader;->logger:Ljava/util/logging/Logger;
  59. iget v4, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->streamId:I
  60. iget v5, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->length:I
  61. iget-byte v6, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->flags:B
  62. invoke-static {v3, v4, v5, v1, v6}, Lokhttp3/internal/http2/Http2;->frameLog(ZIIBB)Ljava/lang/String;
  63. move-result-object v4
  64. invoke-virtual {v2, v4}, Ljava/util/logging/Logger;->fine(Ljava/lang/String;)V
  65. :cond_0
  66. iget-object v2, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  67. invoke-interface {v2}, Lokio/BufferedSource;->readInt()I
  68. move-result v2
  69. const v4, 0x7fffffff
  70. and-int/2addr v2, v4
  71. iput v2, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->streamId:I
  72. const/16 v2, 0x9
  73. const/4 v4, 0x0
  74. if-ne v1, v2, :cond_2
  75. iget v1, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->streamId:I
  76. if-ne v1, v0, :cond_1
  77. return-void
  78. :cond_1
  79. new-array v0, v4, [Ljava/lang/Object;
  80. const-string v1, "TYPE_CONTINUATION streamId changed"
  81. invoke-static {v1, v0}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
  82. move-result-object v0
  83. throw v0
  84. :cond_2
  85. new-array v0, v3, [Ljava/lang/Object;
  86. invoke-static {v1}, Ljava/lang/Byte;->valueOf(B)Ljava/lang/Byte;
  87. move-result-object v1
  88. aput-object v1, v0, v4
  89. const-string v1, "%s != TYPE_CONTINUATION"
  90. invoke-static {v1, v0}, Lokhttp3/internal/http2/Http2;->ioException(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/IOException;
  91. move-result-object v0
  92. throw v0
  93. .end method
  94. # virtual methods
  95. .method public close()V
  96. .locals 0
  97. .annotation system Ldalvik/annotation/Throws;
  98. value = {
  99. Ljava/io/IOException;
  100. }
  101. .end annotation
  102. return-void
  103. .end method
  104. .method public read(Lokio/Buffer;J)J
  105. .locals 6
  106. .annotation system Ldalvik/annotation/Throws;
  107. value = {
  108. Ljava/io/IOException;
  109. }
  110. .end annotation
  111. :goto_0
  112. iget v0, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->left:I
  113. const-wide/16 v1, -0x1
  114. if-nez v0, :cond_1
  115. iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  116. iget-short v3, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->padding:S
  117. int-to-long v3, v3
  118. invoke-interface {v0, v3, v4}, Lokio/BufferedSource;->skip(J)V
  119. const/4 v0, 0x0
  120. iput-short v0, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->padding:S
  121. iget-byte v0, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->flags:B
  122. and-int/lit8 v0, v0, 0x4
  123. if-eqz v0, :cond_0
  124. return-wide v1
  125. :cond_0
  126. invoke-direct {p0}, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->readContinuationHeader()V
  127. goto :goto_0
  128. :cond_1
  129. iget-object v3, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  130. int-to-long v4, v0
  131. invoke-static {p2, p3, v4, v5}, Ljava/lang/Math;->min(JJ)J
  132. move-result-wide p2
  133. invoke-interface {v3, p1, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
  134. move-result-wide p1
  135. cmp-long p3, p1, v1
  136. if-nez p3, :cond_2
  137. return-wide v1
  138. :cond_2
  139. iget p3, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->left:I
  140. int-to-long v0, p3
  141. sub-long/2addr v0, p1
  142. long-to-int p3, v0
  143. iput p3, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->left:I
  144. return-wide p1
  145. .end method
  146. .method public timeout()Lokio/Timeout;
  147. .locals 1
  148. iget-object v0, p0, Lokhttp3/internal/http2/Http2Reader$ContinuationSource;->source:Lokio/BufferedSource;
  149. invoke-interface {v0}, Lokio/Source;->timeout()Lokio/Timeout;
  150. move-result-object v0
  151. return-object v0
  152. .end method