Cache$CacheResponseBody.smali 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. .class Lokhttp3/Cache$CacheResponseBody;
  2. .super Lokhttp3/ResponseBody;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/Cache;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0xa
  10. name = "CacheResponseBody"
  11. .end annotation
  12. # instance fields
  13. .field private final bodySource:Lokio/BufferedSource;
  14. .field private final contentLength:Ljava/lang/String;
  15. .field private final contentType:Ljava/lang/String;
  16. .field final snapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  17. # direct methods
  18. .method constructor <init>(Lokhttp3/internal/cache/DiskLruCache$Snapshot;Ljava/lang/String;Ljava/lang/String;)V
  19. .locals 0
  20. invoke-direct {p0}, Lokhttp3/ResponseBody;-><init>()V
  21. iput-object p1, p0, Lokhttp3/Cache$CacheResponseBody;->snapshot:Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  22. iput-object p2, p0, Lokhttp3/Cache$CacheResponseBody;->contentType:Ljava/lang/String;
  23. iput-object p3, p0, Lokhttp3/Cache$CacheResponseBody;->contentLength:Ljava/lang/String;
  24. const/4 p2, 0x1
  25. invoke-virtual {p1, p2}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->getSource(I)Lokio/Source;
  26. move-result-object p2
  27. new-instance p3, Lokhttp3/Cache$CacheResponseBody$1;
  28. invoke-direct {p3, p0, p2, p1}, Lokhttp3/Cache$CacheResponseBody$1;-><init>(Lokhttp3/Cache$CacheResponseBody;Lokio/Source;Lokhttp3/internal/cache/DiskLruCache$Snapshot;)V
  29. invoke-static {p3}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
  30. move-result-object p1
  31. iput-object p1, p0, Lokhttp3/Cache$CacheResponseBody;->bodySource:Lokio/BufferedSource;
  32. return-void
  33. .end method
  34. # virtual methods
  35. .method public contentLength()J
  36. .locals 3
  37. const-wide/16 v0, -0x1
  38. :try_start_0
  39. iget-object v2, p0, Lokhttp3/Cache$CacheResponseBody;->contentLength:Ljava/lang/String;
  40. if-eqz v2, :cond_0
  41. iget-object v2, p0, Lokhttp3/Cache$CacheResponseBody;->contentLength:Ljava/lang/String;
  42. invoke-static {v2}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
  43. move-result-wide v0
  44. :try_end_0
  45. .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
  46. :catch_0
  47. :cond_0
  48. return-wide v0
  49. .end method
  50. .method public contentType()Lokhttp3/MediaType;
  51. .locals 1
  52. iget-object v0, p0, Lokhttp3/Cache$CacheResponseBody;->contentType:Ljava/lang/String;
  53. if-eqz v0, :cond_0
  54. invoke-static {v0}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;
  55. move-result-object v0
  56. goto :goto_0
  57. :cond_0
  58. const/4 v0, 0x0
  59. :goto_0
  60. return-object v0
  61. .end method
  62. .method public source()Lokio/BufferedSource;
  63. .locals 1
  64. iget-object v0, p0, Lokhttp3/Cache$CacheResponseBody;->bodySource:Lokio/BufferedSource;
  65. return-object v0
  66. .end method