FaultHidingSink.smali 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. .class Lokhttp3/internal/cache/FaultHidingSink;
  2. .super Lokio/ForwardingSink;
  3. .source ""
  4. # instance fields
  5. .field private hasErrors:Z
  6. # direct methods
  7. .method constructor <init>(Lokio/Sink;)V
  8. .locals 0
  9. invoke-direct {p0, p1}, Lokio/ForwardingSink;-><init>(Lokio/Sink;)V
  10. return-void
  11. .end method
  12. # virtual methods
  13. .method public close()V
  14. .locals 2
  15. .annotation system Ldalvik/annotation/Throws;
  16. value = {
  17. Ljava/io/IOException;
  18. }
  19. .end annotation
  20. iget-boolean v0, p0, Lokhttp3/internal/cache/FaultHidingSink;->hasErrors:Z
  21. if-eqz v0, :cond_0
  22. return-void
  23. :cond_0
  24. :try_start_0
  25. invoke-super {p0}, Lokio/ForwardingSink;->close()V
  26. :try_end_0
  27. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  28. goto :goto_0
  29. :catch_0
  30. move-exception v0
  31. const/4 v1, 0x1
  32. iput-boolean v1, p0, Lokhttp3/internal/cache/FaultHidingSink;->hasErrors:Z
  33. invoke-virtual {p0, v0}, Lokhttp3/internal/cache/FaultHidingSink;->onException(Ljava/io/IOException;)V
  34. :goto_0
  35. return-void
  36. .end method
  37. .method public flush()V
  38. .locals 2
  39. .annotation system Ldalvik/annotation/Throws;
  40. value = {
  41. Ljava/io/IOException;
  42. }
  43. .end annotation
  44. iget-boolean v0, p0, Lokhttp3/internal/cache/FaultHidingSink;->hasErrors:Z
  45. if-eqz v0, :cond_0
  46. return-void
  47. :cond_0
  48. :try_start_0
  49. invoke-super {p0}, Lokio/ForwardingSink;->flush()V
  50. :try_end_0
  51. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  52. goto :goto_0
  53. :catch_0
  54. move-exception v0
  55. const/4 v1, 0x1
  56. iput-boolean v1, p0, Lokhttp3/internal/cache/FaultHidingSink;->hasErrors:Z
  57. invoke-virtual {p0, v0}, Lokhttp3/internal/cache/FaultHidingSink;->onException(Ljava/io/IOException;)V
  58. :goto_0
  59. return-void
  60. .end method
  61. .method protected onException(Ljava/io/IOException;)V
  62. .locals 0
  63. return-void
  64. .end method
  65. .method public write(Lokio/Buffer;J)V
  66. .locals 1
  67. .annotation system Ldalvik/annotation/Throws;
  68. value = {
  69. Ljava/io/IOException;
  70. }
  71. .end annotation
  72. iget-boolean v0, p0, Lokhttp3/internal/cache/FaultHidingSink;->hasErrors:Z
  73. if-eqz v0, :cond_0
  74. invoke-virtual {p1, p2, p3}, Lokio/Buffer;->skip(J)V
  75. return-void
  76. :cond_0
  77. :try_start_0
  78. invoke-super {p0, p1, p2, p3}, Lokio/ForwardingSink;->write(Lokio/Buffer;J)V
  79. :try_end_0
  80. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  81. goto :goto_0
  82. :catch_0
  83. move-exception p1
  84. const/4 p2, 0x1
  85. iput-boolean p2, p0, Lokhttp3/internal/cache/FaultHidingSink;->hasErrors:Z
  86. invoke-virtual {p0, p1}, Lokhttp3/internal/cache/FaultHidingSink;->onException(Ljava/io/IOException;)V
  87. :goto_0
  88. return-void
  89. .end method