Pipe.smali 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. .class public final Lokio/Pipe;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/MemberClasses;
  6. value = {
  7. Lokio/Pipe$PipeSource;,
  8. Lokio/Pipe$PipeSink;
  9. }
  10. .end annotation
  11. # instance fields
  12. .field final buffer:Lokio/Buffer;
  13. .field final maxBufferSize:J
  14. .field private final sink:Lokio/Sink;
  15. .field sinkClosed:Z
  16. .field private final source:Lokio/Source;
  17. .field sourceClosed:Z
  18. # direct methods
  19. .method public constructor <init>(J)V
  20. .locals 3
  21. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  22. new-instance v0, Lokio/Buffer;
  23. invoke-direct {v0}, Lokio/Buffer;-><init>()V
  24. iput-object v0, p0, Lokio/Pipe;->buffer:Lokio/Buffer;
  25. new-instance v0, Lokio/Pipe$PipeSink;
  26. invoke-direct {v0, p0}, Lokio/Pipe$PipeSink;-><init>(Lokio/Pipe;)V
  27. iput-object v0, p0, Lokio/Pipe;->sink:Lokio/Sink;
  28. new-instance v0, Lokio/Pipe$PipeSource;
  29. invoke-direct {v0, p0}, Lokio/Pipe$PipeSource;-><init>(Lokio/Pipe;)V
  30. iput-object v0, p0, Lokio/Pipe;->source:Lokio/Source;
  31. const-wide/16 v0, 0x1
  32. cmp-long v2, p1, v0
  33. if-ltz v2, :cond_0
  34. iput-wide p1, p0, Lokio/Pipe;->maxBufferSize:J
  35. return-void
  36. :cond_0
  37. new-instance v0, Ljava/lang/IllegalArgumentException;
  38. new-instance v1, Ljava/lang/StringBuilder;
  39. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  40. const-string v2, "maxBufferSize < 1: "
  41. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  42. invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
  43. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  44. move-result-object p1
  45. invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
  46. throw v0
  47. .end method
  48. # virtual methods
  49. .method public sink()Lokio/Sink;
  50. .locals 1
  51. iget-object v0, p0, Lokio/Pipe;->sink:Lokio/Sink;
  52. return-object v0
  53. .end method
  54. .method public source()Lokio/Source;
  55. .locals 1
  56. iget-object v0, p0, Lokio/Pipe;->source:Lokio/Source;
  57. return-object v0
  58. .end method