Http2Codec$StreamFinishingSource.smali 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. .class Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;
  2. .super Lokio/ForwardingSource;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/internal/http2/Http2Codec;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x0
  10. name = "StreamFinishingSource"
  11. .end annotation
  12. # instance fields
  13. .field bytesRead:J
  14. .field completed:Z
  15. .field final synthetic this$0:Lokhttp3/internal/http2/Http2Codec;
  16. # direct methods
  17. .method constructor <init>(Lokhttp3/internal/http2/Http2Codec;Lokio/Source;)V
  18. .locals 0
  19. iput-object p1, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->this$0:Lokhttp3/internal/http2/Http2Codec;
  20. invoke-direct {p0, p2}, Lokio/ForwardingSource;-><init>(Lokio/Source;)V
  21. const/4 p1, 0x0
  22. iput-boolean p1, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->completed:Z
  23. const-wide/16 p1, 0x0
  24. iput-wide p1, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->bytesRead:J
  25. return-void
  26. .end method
  27. .method private endOfInput(Ljava/io/IOException;)V
  28. .locals 7
  29. iget-boolean v0, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->completed:Z
  30. if-eqz v0, :cond_0
  31. return-void
  32. :cond_0
  33. const/4 v0, 0x1
  34. iput-boolean v0, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->completed:Z
  35. iget-object v3, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->this$0:Lokhttp3/internal/http2/Http2Codec;
  36. iget-object v1, v3, Lokhttp3/internal/http2/Http2Codec;->streamAllocation:Lokhttp3/internal/connection/StreamAllocation;
  37. const/4 v2, 0x0
  38. iget-wide v4, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->bytesRead:J
  39. move-object v6, p1
  40. invoke-virtual/range {v1 .. v6}, Lokhttp3/internal/connection/StreamAllocation;->streamFinished(ZLokhttp3/internal/http/HttpCodec;JLjava/io/IOException;)V
  41. return-void
  42. .end method
  43. # virtual methods
  44. .method public close()V
  45. .locals 1
  46. .annotation system Ldalvik/annotation/Throws;
  47. value = {
  48. Ljava/io/IOException;
  49. }
  50. .end annotation
  51. invoke-super {p0}, Lokio/ForwardingSource;->close()V
  52. const/4 v0, 0x0
  53. invoke-direct {p0, v0}, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->endOfInput(Ljava/io/IOException;)V
  54. return-void
  55. .end method
  56. .method public read(Lokio/Buffer;J)J
  57. .locals 2
  58. .annotation system Ldalvik/annotation/Throws;
  59. value = {
  60. Ljava/io/IOException;
  61. }
  62. .end annotation
  63. :try_start_0
  64. invoke-virtual {p0}, Lokio/ForwardingSource;->delegate()Lokio/Source;
  65. move-result-object v0
  66. invoke-interface {v0, p1, p2, p3}, Lokio/Source;->read(Lokio/Buffer;J)J
  67. move-result-wide p1
  68. const-wide/16 v0, 0x0
  69. cmp-long p3, p1, v0
  70. if-lez p3, :cond_0
  71. iget-wide v0, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->bytesRead:J
  72. add-long/2addr v0, p1
  73. iput-wide v0, p0, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->bytesRead:J
  74. :try_end_0
  75. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  76. :cond_0
  77. return-wide p1
  78. :catch_0
  79. move-exception p1
  80. invoke-direct {p0, p1}, Lokhttp3/internal/http2/Http2Codec$StreamFinishingSource;->endOfInput(Ljava/io/IOException;)V
  81. throw p1
  82. .end method