Http1Codec$UnknownLengthSource.smali 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. .class Lokhttp3/internal/http1/Http1Codec$UnknownLengthSource;
  2. .super Lokhttp3/internal/http1/Http1Codec$AbstractSource;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/internal/http1/Http1Codec;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x2
  10. name = "UnknownLengthSource"
  11. .end annotation
  12. # instance fields
  13. .field private inputExhausted:Z
  14. .field final synthetic this$0:Lokhttp3/internal/http1/Http1Codec;
  15. # direct methods
  16. .method constructor <init>(Lokhttp3/internal/http1/Http1Codec;)V
  17. .locals 1
  18. iput-object p1, p0, Lokhttp3/internal/http1/Http1Codec$UnknownLengthSource;->this$0:Lokhttp3/internal/http1/Http1Codec;
  19. const/4 v0, 0x0
  20. invoke-direct {p0, p1, v0}, Lokhttp3/internal/http1/Http1Codec$AbstractSource;-><init>(Lokhttp3/internal/http1/Http1Codec;Lokhttp3/internal/http1/Http1Codec$1;)V
  21. return-void
  22. .end method
  23. # virtual methods
  24. .method public close()V
  25. .locals 2
  26. .annotation system Ldalvik/annotation/Throws;
  27. value = {
  28. Ljava/io/IOException;
  29. }
  30. .end annotation
  31. iget-boolean v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->closed:Z
  32. if-eqz v0, :cond_0
  33. return-void
  34. :cond_0
  35. iget-boolean v0, p0, Lokhttp3/internal/http1/Http1Codec$UnknownLengthSource;->inputExhausted:Z
  36. if-nez v0, :cond_1
  37. const/4 v0, 0x0
  38. const/4 v1, 0x0
  39. invoke-virtual {p0, v0, v1}, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->endOfInput(ZLjava/io/IOException;)V
  40. :cond_1
  41. const/4 v0, 0x1
  42. iput-boolean v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->closed:Z
  43. return-void
  44. .end method
  45. .method public read(Lokio/Buffer;J)J
  46. .locals 3
  47. .annotation system Ldalvik/annotation/Throws;
  48. value = {
  49. Ljava/io/IOException;
  50. }
  51. .end annotation
  52. const-wide/16 v0, 0x0
  53. cmp-long v2, p2, v0
  54. if-ltz v2, :cond_3
  55. iget-boolean v0, p0, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->closed:Z
  56. if-nez v0, :cond_2
  57. iget-boolean v0, p0, Lokhttp3/internal/http1/Http1Codec$UnknownLengthSource;->inputExhausted:Z
  58. const-wide/16 v1, -0x1
  59. if-eqz v0, :cond_0
  60. return-wide v1
  61. :cond_0
  62. invoke-super {p0, p1, p2, p3}, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->read(Lokio/Buffer;J)J
  63. move-result-wide p1
  64. cmp-long p3, p1, v1
  65. if-nez p3, :cond_1
  66. const/4 p1, 0x1
  67. iput-boolean p1, p0, Lokhttp3/internal/http1/Http1Codec$UnknownLengthSource;->inputExhausted:Z
  68. const/4 p2, 0x0
  69. invoke-virtual {p0, p1, p2}, Lokhttp3/internal/http1/Http1Codec$AbstractSource;->endOfInput(ZLjava/io/IOException;)V
  70. return-wide v1
  71. :cond_1
  72. return-wide p1
  73. :cond_2
  74. new-instance p1, Ljava/lang/IllegalStateException;
  75. const-string p2, "closed"
  76. invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  77. throw p1
  78. :cond_3
  79. new-instance p1, Ljava/lang/IllegalArgumentException;
  80. new-instance v0, Ljava/lang/StringBuilder;
  81. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  82. const-string v1, "byteCount < 0: "
  83. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  84. invoke-virtual {v0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  85. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  86. move-result-object p2
  87. invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  88. throw p1
  89. .end method