.class public final Lokio/InflaterSource; .super Ljava/lang/Object; .source "InflaterSource.kt" # interfaces .implements Lokio/Source; # annotations .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nInflaterSource.kt\nKotlin\n*S Kotlin\n*F\n+ 1 InflaterSource.kt\nokio/InflaterSource\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 -Util.kt\nokio/-Util\n*L\n1#1,147:1\n1#2:148\n75#3:149\n*E\n*S KotlinDebug\n*F\n+ 1 InflaterSource.kt\nokio/InflaterSource\n*L\n73#1:149\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0008\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0005\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0017\u0008\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0001\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u00a2\u0006\u0002\u0010\u0005B\u0017\u0008\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0006\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u00a2\u0006\u0002\u0010\u0007J\u0008\u0010\u000c\u001a\u00020\rH\u0016J\u0018\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u000fH\u0016J\u0016\u0010\u0013\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u000fJ\u0006\u0010\u0014\u001a\u00020\u000bJ\u0008\u0010\u0015\u001a\u00020\rH\u0002J\u0008\u0010\u0016\u001a\u00020\u0017H\u0016R\u000e\u0010\u0008\u001a\u00020\tX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0006X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0018" } d2 = { "Lokio/InflaterSource;", "Lokio/Source;", "source", "inflater", "Ljava/util/zip/Inflater;", "(Lokio/Source;Ljava/util/zip/Inflater;)V", "Lokio/BufferedSource;", "(Lokio/BufferedSource;Ljava/util/zip/Inflater;)V", "bufferBytesHeldByInflater", "", "closed", "", "close", "", "read", "", "sink", "Lokio/Buffer;", "byteCount", "readOrInflate", "refill", "releaseBytesAfterInflate", "timeout", "Lokio/Timeout;", "okio" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # instance fields .field private bufferBytesHeldByInflater:I .field private closed:Z .field private final inflater:Ljava/util/zip/Inflater; .field private final source:Lokio/BufferedSource; # direct methods .method public constructor (Lokio/BufferedSource;Ljava/util/zip/Inflater;)V .locals 1 const-string v0, "source" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "inflater" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 35 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource; iput-object p2, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; return-void .end method .method public constructor (Lokio/Source;Ljava/util/zip/Inflater;)V .locals 1 const-string v0, "source" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "inflater" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 44 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource; move-result-object p1 invoke-direct {p0, p1, p2}, Lokio/InflaterSource;->(Lokio/BufferedSource;Ljava/util/zip/Inflater;)V return-void .end method .method private final releaseBytesAfterInflate()V .locals 2 iget v0, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I if-nez v0, :cond_0 return-void :cond_0 iget-object v1, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; .line 124 invoke-virtual {v1}, Ljava/util/zip/Inflater;->getRemaining()I move-result v1 sub-int/2addr v0, v1 iget v1, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I sub-int/2addr v1, v0 iput v1, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I iget-object p0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource; int-to-long v0, v0 .line 126 invoke-interface {p0, v0, v1}, Lokio/BufferedSource;->skip(J)V return-void .end method # virtual methods .method public close()V .locals 1 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-boolean v0, p0, Lokio/InflaterSource;->closed:Z if-eqz v0, :cond_0 return-void :cond_0 iget-object v0, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; .line 134 invoke-virtual {v0}, Ljava/util/zip/Inflater;->end()V const/4 v0, 0x1 iput-boolean v0, p0, Lokio/InflaterSource;->closed:Z iget-object p0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource; .line 136 invoke-interface {p0}, Lokio/BufferedSource;->close()V return-void .end method .method public read(Lokio/Buffer;J)J .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const-string v0, "sink" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 49 :goto_0 invoke-virtual {p0, p1, p2, p3}, Lokio/InflaterSource;->readOrInflate(Lokio/Buffer;J)J move-result-wide v0 const-wide/16 v2, 0x0 cmp-long v2, v0, v2 if-lez v2, :cond_0 return-wide v0 :cond_0 iget-object v0, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; .line 51 invoke-virtual {v0}, Ljava/util/zip/Inflater;->finished()Z move-result v0 if-nez v0, :cond_3 iget-object v0, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; invoke-virtual {v0}, Ljava/util/zip/Inflater;->needsDictionary()Z move-result v0 if-eqz v0, :cond_1 goto :goto_1 :cond_1 iget-object v0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource; .line 52 invoke-interface {v0}, Lokio/BufferedSource;->exhausted()Z move-result v0 if-nez v0, :cond_2 goto :goto_0 :cond_2 new-instance p0, Ljava/io/EOFException; const-string p1, "source exhausted prematurely" invoke-direct {p0, p1}, Ljava/io/EOFException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 :cond_3 :goto_1 const-wide/16 p0, -0x1 return-wide p0 .end method .method public final readOrInflate(Lokio/Buffer;J)J .locals 5 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const-string v0, "sink" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-wide/16 v0, 0x0 cmp-long v2, p2, v0 const/4 v3, 0x1 if-ltz v2, :cond_0 move v4, v3 goto :goto_0 :cond_0 const/4 v4, 0x0 :goto_0 if-eqz v4, :cond_5 iget-boolean v4, p0, Lokio/InflaterSource;->closed:Z xor-int/2addr v4, v3 if-eqz v4, :cond_4 if-nez v2, :cond_1 return-wide v0 .line 72 :cond_1 :try_start_0 invoke-virtual {p1, v3}, Lokio/Buffer;->writableSegment$okio(I)Lokio/Segment; move-result-object v2 .line 73 iget v3, v2, Lokio/Segment;->limit:I rsub-int v3, v3, 0x2000 int-to-long v3, v3 .line 149 invoke-static {p2, p3, v3, v4}, Ljava/lang/Math;->min(JJ)J move-result-wide p2 long-to-int p2, p2 .line 76 invoke-virtual {p0}, Lokio/InflaterSource;->refill()Z iget-object p3, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; .line 79 iget-object v3, v2, Lokio/Segment;->data:[B iget v4, v2, Lokio/Segment;->limit:I invoke-virtual {p3, v3, v4, p2}, Ljava/util/zip/Inflater;->inflate([BII)I move-result p2 .line 82 invoke-direct {p0}, Lokio/InflaterSource;->releaseBytesAfterInflate()V if-lez p2, :cond_2 .line 86 iget p0, v2, Lokio/Segment;->limit:I add-int/2addr p0, p2 iput p0, v2, Lokio/Segment;->limit:I .line 87 invoke-virtual {p1}, Lokio/Buffer;->size()J move-result-wide v0 int-to-long p2, p2 add-long/2addr v0, p2 invoke-virtual {p1, v0, v1}, Lokio/Buffer;->setSize$okio(J)V return-wide p2 .line 92 :cond_2 iget p0, v2, Lokio/Segment;->pos:I iget p2, v2, Lokio/Segment;->limit:I if-ne p0, p2, :cond_3 .line 93 invoke-virtual {v2}, Lokio/Segment;->pop()Lokio/Segment; move-result-object p0 iput-object p0, p1, Lokio/Buffer;->head:Lokio/Segment; .line 94 invoke-static {v2}, Lokio/SegmentPool;->recycle(Lokio/Segment;)V :try_end_0 .catch Ljava/util/zip/DataFormatException; {:try_start_0 .. :try_end_0} :catch_0 :cond_3 return-wide v0 :catch_0 move-exception p0 .line 99 new-instance p1, Ljava/io/IOException; check-cast p0, Ljava/lang/Throwable; invoke-direct {p1, p0}, Ljava/io/IOException;->(Ljava/lang/Throwable;)V check-cast p1, Ljava/lang/Throwable; throw p1 .line 67 :cond_4 new-instance p0, Ljava/lang/IllegalStateException; const-string p1, "closed" invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V check-cast p0, Ljava/lang/Throwable; throw p0 .line 66 :cond_5 new-instance p0, Ljava/lang/StringBuilder; const-string p1, "byteCount < 0: " invoke-direct {p0, p1}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p0, p2, p3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 new-instance p1, Ljava/lang/IllegalArgumentException; invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p0 invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p1, Ljava/lang/Throwable; throw p1 .end method .method public final refill()Z .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-object v0, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; .line 109 invoke-virtual {v0}, Ljava/util/zip/Inflater;->needsInput()Z move-result v0 const/4 v1, 0x0 if-nez v0, :cond_0 return v1 :cond_0 iget-object v0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource; .line 112 invoke-interface {v0}, Lokio/BufferedSource;->exhausted()Z move-result v0 if-eqz v0, :cond_1 const/4 p0, 0x1 return p0 :cond_1 iget-object v0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource; .line 115 invoke-interface {v0}, Lokio/BufferedSource;->getBuffer()Lokio/Buffer; move-result-object v0 iget-object v0, v0, Lokio/Buffer;->head:Lokio/Segment; invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V .line 116 iget v2, v0, Lokio/Segment;->limit:I iget v3, v0, Lokio/Segment;->pos:I sub-int/2addr v2, v3 iput v2, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I iget-object v2, p0, Lokio/InflaterSource;->inflater:Ljava/util/zip/Inflater; .line 117 iget-object v3, v0, Lokio/Segment;->data:[B iget v0, v0, Lokio/Segment;->pos:I iget p0, p0, Lokio/InflaterSource;->bufferBytesHeldByInflater:I invoke-virtual {v2, v3, v0, p0}, Ljava/util/zip/Inflater;->setInput([BII)V return v1 .end method .method public timeout()Lokio/Timeout; .locals 0 iget-object p0, p0, Lokio/InflaterSource;->source:Lokio/BufferedSource; .line 129 invoke-interface {p0}, Lokio/BufferedSource;->timeout()Lokio/Timeout; move-result-object p0 return-object p0 .end method