RealBufferedSink$1.smali 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. .class Lokio/RealBufferedSink$1;
  2. .super Ljava/io/OutputStream;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingMethod;
  6. value = Lokio/RealBufferedSink;->outputStream()Ljava/io/OutputStream;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x0
  10. name = null
  11. .end annotation
  12. # instance fields
  13. .field final synthetic this$0:Lokio/RealBufferedSink;
  14. # direct methods
  15. .method constructor <init>(Lokio/RealBufferedSink;)V
  16. .locals 0
  17. iput-object p1, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  18. invoke-direct {p0}, Ljava/io/OutputStream;-><init>()V
  19. return-void
  20. .end method
  21. # virtual methods
  22. .method public close()V
  23. .locals 1
  24. .annotation system Ldalvik/annotation/Throws;
  25. value = {
  26. Ljava/io/IOException;
  27. }
  28. .end annotation
  29. iget-object v0, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  30. invoke-virtual {v0}, Lokio/RealBufferedSink;->close()V
  31. return-void
  32. .end method
  33. .method public flush()V
  34. .locals 2
  35. .annotation system Ldalvik/annotation/Throws;
  36. value = {
  37. Ljava/io/IOException;
  38. }
  39. .end annotation
  40. iget-object v0, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  41. iget-boolean v1, v0, Lokio/RealBufferedSink;->closed:Z
  42. if-nez v1, :cond_0
  43. invoke-virtual {v0}, Lokio/RealBufferedSink;->flush()V
  44. :cond_0
  45. return-void
  46. .end method
  47. .method public toString()Ljava/lang/String;
  48. .locals 2
  49. new-instance v0, Ljava/lang/StringBuilder;
  50. invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
  51. iget-object v1, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  52. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
  53. const-string v1, ".outputStream()"
  54. invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  55. invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  56. move-result-object v0
  57. return-object v0
  58. .end method
  59. .method public write(I)V
  60. .locals 2
  61. .annotation system Ldalvik/annotation/Throws;
  62. value = {
  63. Ljava/io/IOException;
  64. }
  65. .end annotation
  66. iget-object v0, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  67. iget-boolean v1, v0, Lokio/RealBufferedSink;->closed:Z
  68. if-nez v1, :cond_0
  69. iget-object v0, v0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  70. int-to-byte p1, p1
  71. invoke-virtual {v0, p1}, Lokio/Buffer;->writeByte(I)Lokio/Buffer;
  72. iget-object p1, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  73. invoke-virtual {p1}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  74. return-void
  75. :cond_0
  76. new-instance p1, Ljava/io/IOException;
  77. const-string v0, "closed"
  78. invoke-direct {p1, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  79. throw p1
  80. .end method
  81. .method public write([BII)V
  82. .locals 2
  83. .annotation system Ldalvik/annotation/Throws;
  84. value = {
  85. Ljava/io/IOException;
  86. }
  87. .end annotation
  88. iget-object v0, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  89. iget-boolean v1, v0, Lokio/RealBufferedSink;->closed:Z
  90. if-nez v1, :cond_0
  91. iget-object v0, v0, Lokio/RealBufferedSink;->buffer:Lokio/Buffer;
  92. invoke-virtual {v0, p1, p2, p3}, Lokio/Buffer;->write([BII)Lokio/Buffer;
  93. iget-object p1, p0, Lokio/RealBufferedSink$1;->this$0:Lokio/RealBufferedSink;
  94. invoke-virtual {p1}, Lokio/RealBufferedSink;->emitCompleteSegments()Lokio/BufferedSink;
  95. return-void
  96. :cond_0
  97. new-instance p1, Ljava/io/IOException;
  98. const-string p2, "closed"
  99. invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
  100. throw p1
  101. .end method