package okio; import androidx.core.location.LocationRequestCompat; import io.sentry.ProfilingTraceData; import io.sentry.SentryBaseEvent; import io.sentry.protocol.TransactionInfo; import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.charset.Charset; import kotlin.Metadata; import kotlin.jvm.internal.Intrinsics; import kotlin.text.CharsKt; import okio.internal.BufferKt; /* compiled from: RealBufferedSource.kt */ @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0086\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u0005\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\n\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\u0005\u001a\u00020\u0006H\u0016J\b\u0010\u000e\u001a\u00020\u000fH\u0016J\b\u0010\u0010\u001a\u00020\rH\u0016J\u0010\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0014H\u0016J\u0018\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0012H\u0016J \u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u00122\u0006\u0010\u0016\u001a\u00020\u0012H\u0016J\u0010\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0017\u001a\u00020\u0018H\u0016J\u0018\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0015\u001a\u00020\u0012H\u0016J\u0010\u0010\u0019\u001a\u00020\u00122\u0006\u0010\u001a\u001a\u00020\u0018H\u0016J\u0018\u0010\u0019\u001a\u00020\u00122\u0006\u0010\u001a\u001a\u00020\u00182\u0006\u0010\u0015\u001a\u00020\u0012H\u0016J\b\u0010\u001b\u001a\u00020\u001cH\u0016J\b\u0010\u001d\u001a\u00020\rH\u0016J\b\u0010\u001e\u001a\u00020\u0001H\u0016J\u0018\u0010\u001f\u001a\u00020\r2\u0006\u0010 \u001a\u00020\u00122\u0006\u0010\u0017\u001a\u00020\u0018H\u0016J(\u0010\u001f\u001a\u00020\r2\u0006\u0010 \u001a\u00020\u00122\u0006\u0010\u0017\u001a\u00020\u00182\u0006\u0010!\u001a\u00020\"2\u0006\u0010#\u001a\u00020\"H\u0016J\u0010\u0010$\u001a\u00020\"2\u0006\u0010%\u001a\u00020&H\u0016J\u0010\u0010$\u001a\u00020\"2\u0006\u0010%\u001a\u00020'H\u0016J \u0010$\u001a\u00020\"2\u0006\u0010%\u001a\u00020'2\u0006\u0010 \u001a\u00020\"2\u0006\u0010#\u001a\u00020\"H\u0016J\u0018\u0010$\u001a\u00020\u00122\u0006\u0010%\u001a\u00020\u00062\u0006\u0010#\u001a\u00020\u0012H\u0016J\u0010\u0010(\u001a\u00020\u00122\u0006\u0010%\u001a\u00020)H\u0016J\b\u0010*\u001a\u00020\u0014H\u0016J\b\u0010+\u001a\u00020'H\u0016J\u0010\u0010+\u001a\u00020'2\u0006\u0010#\u001a\u00020\u0012H\u0016J\b\u0010,\u001a\u00020\u0018H\u0016J\u0010\u0010,\u001a\u00020\u00182\u0006\u0010#\u001a\u00020\u0012H\u0016J\b\u0010-\u001a\u00020\u0012H\u0016J\u0010\u0010.\u001a\u00020\u000f2\u0006\u0010%\u001a\u00020'H\u0016J\u0018\u0010.\u001a\u00020\u000f2\u0006\u0010%\u001a\u00020\u00062\u0006\u0010#\u001a\u00020\u0012H\u0016J\b\u0010/\u001a\u00020\u0012H\u0016J\b\u00100\u001a\u00020\"H\u0016J\b\u00101\u001a\u00020\"H\u0016J\b\u00102\u001a\u00020\u0012H\u0016J\b\u00103\u001a\u00020\u0012H\u0016J\b\u00104\u001a\u000205H\u0016J\b\u00106\u001a\u000205H\u0016J\u0010\u00107\u001a\u0002082\u0006\u00109\u001a\u00020:H\u0016J\u0018\u00107\u001a\u0002082\u0006\u0010#\u001a\u00020\u00122\u0006\u00109\u001a\u00020:H\u0016J\b\u0010;\u001a\u000208H\u0016J\u0010\u0010;\u001a\u0002082\u0006\u0010#\u001a\u00020\u0012H\u0016J\b\u0010<\u001a\u00020\"H\u0016J\n\u0010=\u001a\u0004\u0018\u000108H\u0016J\b\u0010>\u001a\u000208H\u0016J\u0010\u0010>\u001a\u0002082\u0006\u0010?\u001a\u00020\u0012H\u0016J\u0010\u0010@\u001a\u00020\r2\u0006\u0010#\u001a\u00020\u0012H\u0016J\u0010\u0010A\u001a\u00020\u000f2\u0006\u0010#\u001a\u00020\u0012H\u0016J\u0010\u0010B\u001a\u00020\"2\u0006\u0010C\u001a\u00020DH\u0016J\u0010\u0010E\u001a\u00020\u000f2\u0006\u0010#\u001a\u00020\u0012H\u0016J\b\u0010F\u001a\u00020GH\u0016J\b\u0010H\u001a\u000208H\u0016R\u001b\u0010\u0005\u001a\u00020\u00068Ö\u0002X\u0096\u0004¢\u0006\f\u0012\u0004\b\u0007\u0010\b\u001a\u0004\b\t\u0010\nR\u0010\u0010\u000b\u001a\u00020\u00068\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\f\u001a\u00020\r8\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0002\u001a\u00020\u00038\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006I"}, d2 = {"Lokio/RealBufferedSource;", "Lokio/BufferedSource;", TransactionInfo.JsonKeys.SOURCE, "Lokio/Source;", "(Lokio/Source;)V", "buffer", "Lokio/Buffer;", "getBuffer$annotations", "()V", "getBuffer", "()Lokio/Buffer;", "bufferField", "closed", "", "close", "", "exhausted", "indexOf", "", "b", "", "fromIndex", "toIndex", "bytes", "Lokio/ByteString;", "indexOfElement", "targetBytes", "inputStream", "Ljava/io/InputStream;", "isOpen", "peek", "rangeEquals", "offset", "bytesOffset", "", "byteCount", "read", "sink", "Ljava/nio/ByteBuffer;", "", "readAll", "Lokio/Sink;", "readByte", "readByteArray", "readByteString", "readDecimalLong", "readFully", "readHexadecimalUnsignedLong", "readInt", "readIntLe", "readLong", "readLongLe", "readShort", "", "readShortLe", "readString", "", "charset", "Ljava/nio/charset/Charset;", "readUtf8", "readUtf8CodePoint", "readUtf8Line", "readUtf8LineStrict", "limit", SentryBaseEvent.JsonKeys.REQUEST, "require", "select", "options", "Lokio/Options;", "skip", ProfilingTraceData.TRUNCATION_REASON_TIMEOUT, "Lokio/Timeout;", "toString", "okio"}, k = 1, mv = {1, 4, 0}) /* loaded from: classes3.dex */ public final class RealBufferedSource implements BufferedSource { public final Buffer bufferField; public boolean closed; public final Source source; public static /* synthetic */ void getBuffer$annotations() { } @Override // okio.BufferedSource, okio.BufferedSink /* renamed from: buffer, reason: from getter */ public Buffer getBufferField() { return this.bufferField; } @Override // okio.BufferedSource, okio.BufferedSink public Buffer getBuffer() { return this.bufferField; } @Override // java.nio.channels.Channel public boolean isOpen() { return !this.closed; } public RealBufferedSource(Source source) { Intrinsics.checkNotNullParameter(source, "source"); this.source = source; this.bufferField = new Buffer(); } @Override // okio.BufferedSource public int read(byte[] sink) { Intrinsics.checkNotNullParameter(sink, "sink"); return read(sink, 0, sink.length); } @Override // java.nio.channels.ReadableByteChannel public int read(ByteBuffer sink) { Intrinsics.checkNotNullParameter(sink, "sink"); if (this.bufferField.size() == 0 && this.source.read(this.bufferField, 8192) == -1) { return -1; } return this.bufferField.read(sink); } @Override // okio.BufferedSource public String readString(Charset charset) { Intrinsics.checkNotNullParameter(charset, "charset"); this.bufferField.writeAll(this.source); return this.bufferField.readString(charset); } @Override // okio.BufferedSource public String readString(long byteCount, Charset charset) { Intrinsics.checkNotNullParameter(charset, "charset"); require(byteCount); return this.bufferField.readString(byteCount, charset); } @Override // okio.BufferedSource public String readUtf8LineStrict() { return readUtf8LineStrict(Long.MAX_VALUE); } @Override // okio.BufferedSource public long indexOf(byte b) { return indexOf(b, 0L, Long.MAX_VALUE); } @Override // okio.BufferedSource public long indexOf(byte b, long fromIndex) { return indexOf(b, fromIndex, Long.MAX_VALUE); } @Override // okio.BufferedSource public long indexOf(ByteString bytes) { Intrinsics.checkNotNullParameter(bytes, "bytes"); return indexOf(bytes, 0L); } @Override // okio.BufferedSource public long indexOfElement(ByteString targetBytes) { Intrinsics.checkNotNullParameter(targetBytes, "targetBytes"); return indexOfElement(targetBytes, 0L); } @Override // okio.BufferedSource public boolean rangeEquals(long offset, ByteString bytes) { Intrinsics.checkNotNullParameter(bytes, "bytes"); return rangeEquals(offset, bytes, 0, bytes.size()); } @Override // okio.BufferedSource public InputStream inputStream() { return new InputStream() { // from class: okio.RealBufferedSource$inputStream$1 @Override // java.io.InputStream public int read() { if (RealBufferedSource.this.closed) { throw new IOException("closed"); } if (RealBufferedSource.this.bufferField.size() == 0 && RealBufferedSource.this.source.read(RealBufferedSource.this.bufferField, 8192) == -1) { return -1; } return RealBufferedSource.this.bufferField.readByte() & 255; } @Override // java.io.InputStream public int read(byte[] data, int offset, int byteCount) { Intrinsics.checkNotNullParameter(data, "data"); if (RealBufferedSource.this.closed) { throw new IOException("closed"); } Util.checkOffsetAndCount(data.length, offset, byteCount); if (RealBufferedSource.this.bufferField.size() == 0 && RealBufferedSource.this.source.read(RealBufferedSource.this.bufferField, 8192) == -1) { return -1; } return RealBufferedSource.this.bufferField.read(data, offset, byteCount); } @Override // java.io.InputStream public int available() { if (RealBufferedSource.this.closed) { throw new IOException("closed"); } return (int) Math.min(RealBufferedSource.this.bufferField.size(), Integer.MAX_VALUE); } @Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable public void close() { RealBufferedSource.this.close(); } public String toString() { return RealBufferedSource.this + ".inputStream()"; } }; } @Override // okio.Source public long read(Buffer sink, long byteCount) { Intrinsics.checkNotNullParameter(sink, "sink"); if (!(byteCount >= 0)) { throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString()); } if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } if (this.bufferField.size() == 0 && this.source.read(this.bufferField, 8192) == -1) { return -1L; } return this.bufferField.read(sink, Math.min(byteCount, this.bufferField.size())); } @Override // okio.BufferedSource public boolean exhausted() { if (!this.closed) { return this.bufferField.exhausted() && this.source.read(this.bufferField, (long) 8192) == -1; } throw new IllegalStateException("closed".toString()); } @Override // okio.BufferedSource public void require(long byteCount) { if (!request(byteCount)) { throw new EOFException(); } } @Override // okio.BufferedSource public boolean request(long byteCount) { if (!(byteCount >= 0)) { throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString()); } if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } while (this.bufferField.size() < byteCount) { if (this.source.read(this.bufferField, 8192) == -1) { return false; } } return true; } @Override // okio.BufferedSource public byte readByte() { require(1L); return this.bufferField.readByte(); } @Override // okio.BufferedSource public ByteString readByteString() { this.bufferField.writeAll(this.source); return this.bufferField.readByteString(); } @Override // okio.BufferedSource public ByteString readByteString(long byteCount) { require(byteCount); return this.bufferField.readByteString(byteCount); } @Override // okio.BufferedSource public int select(Options options) { Intrinsics.checkNotNullParameter(options, "options"); if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } while (true) { int selectPrefix = BufferKt.selectPrefix(this.bufferField, options, true); if (selectPrefix != -2) { if (selectPrefix != -1) { this.bufferField.skip(options.getByteStrings()[selectPrefix].size()); return selectPrefix; } } else if (this.source.read(this.bufferField, 8192) == -1) { break; } } return -1; } @Override // okio.BufferedSource public byte[] readByteArray() { this.bufferField.writeAll(this.source); return this.bufferField.readByteArray(); } @Override // okio.BufferedSource public byte[] readByteArray(long byteCount) { require(byteCount); return this.bufferField.readByteArray(byteCount); } @Override // okio.BufferedSource public void readFully(byte[] sink) { Intrinsics.checkNotNullParameter(sink, "sink"); try { require(sink.length); this.bufferField.readFully(sink); } catch (EOFException e) { int i = 0; while (this.bufferField.size() > 0) { Buffer buffer = this.bufferField; int read = buffer.read(sink, i, (int) buffer.size()); if (read == -1) { throw new AssertionError(); } i += read; } throw e; } } @Override // okio.BufferedSource public int read(byte[] sink, int offset, int byteCount) { Intrinsics.checkNotNullParameter(sink, "sink"); long j = byteCount; Util.checkOffsetAndCount(sink.length, offset, j); if (this.bufferField.size() == 0 && this.source.read(this.bufferField, 8192) == -1) { return -1; } return this.bufferField.read(sink, offset, (int) Math.min(j, this.bufferField.size())); } @Override // okio.BufferedSource public void readFully(Buffer sink, long byteCount) { Intrinsics.checkNotNullParameter(sink, "sink"); try { require(byteCount); this.bufferField.readFully(sink, byteCount); } catch (EOFException e) { sink.writeAll(this.bufferField); throw e; } } @Override // okio.BufferedSource public long readAll(Sink sink) { Intrinsics.checkNotNullParameter(sink, "sink"); long j = 0; while (this.source.read(this.bufferField, 8192) != -1) { long completeSegmentByteCount = this.bufferField.completeSegmentByteCount(); if (completeSegmentByteCount > 0) { j += completeSegmentByteCount; sink.write(this.bufferField, completeSegmentByteCount); } } if (this.bufferField.size() <= 0) { return j; } long size = j + this.bufferField.size(); Buffer buffer = this.bufferField; sink.write(buffer, buffer.size()); return size; } @Override // okio.BufferedSource public String readUtf8() { this.bufferField.writeAll(this.source); return this.bufferField.readUtf8(); } @Override // okio.BufferedSource public String readUtf8(long byteCount) { require(byteCount); return this.bufferField.readUtf8(byteCount); } @Override // okio.BufferedSource public String readUtf8Line() { long indexOf = indexOf((byte) 10); if (indexOf != -1) { return BufferKt.readUtf8Line(this.bufferField, indexOf); } if (this.bufferField.size() != 0) { return readUtf8(this.bufferField.size()); } return null; } @Override // okio.BufferedSource public String readUtf8LineStrict(long limit) { if (!(limit >= 0)) { throw new IllegalArgumentException(("limit < 0: " + limit).toString()); } long j = limit == Long.MAX_VALUE ? Long.MAX_VALUE : limit + 1; byte b = (byte) 10; long indexOf = indexOf(b, 0L, j); if (indexOf != -1) { return BufferKt.readUtf8Line(this.bufferField, indexOf); } if (j < Long.MAX_VALUE && request(j) && this.bufferField.getByte(j - 1) == ((byte) 13) && request(1 + j) && this.bufferField.getByte(j) == b) { return BufferKt.readUtf8Line(this.bufferField, j); } Buffer buffer = new Buffer(); Buffer buffer2 = this.bufferField; buffer2.copyTo(buffer, 0L, Math.min(32, buffer2.size())); throw new EOFException("\\n not found: limit=" + Math.min(this.bufferField.size(), limit) + " content=" + buffer.readByteString().hex() + "…"); } @Override // okio.BufferedSource public int readUtf8CodePoint() { require(1L); byte b = this.bufferField.getByte(0L); if ((b & 224) == 192) { require(2L); } else if ((b & 240) == 224) { require(3L); } else if ((b & 248) == 240) { require(4L); } return this.bufferField.readUtf8CodePoint(); } @Override // okio.BufferedSource public short readShort() { require(2L); return this.bufferField.readShort(); } @Override // okio.BufferedSource public short readShortLe() { require(2L); return this.bufferField.readShortLe(); } @Override // okio.BufferedSource public int readInt() { require(4L); return this.bufferField.readInt(); } @Override // okio.BufferedSource public int readIntLe() { require(4L); return this.bufferField.readIntLe(); } @Override // okio.BufferedSource public long readLong() { require(8L); return this.bufferField.readLong(); } @Override // okio.BufferedSource public long readLongLe() { require(8L); return this.bufferField.readLongLe(); } /* JADX WARN: Code restructure failed: missing block: B:15:0x002c, code lost: if (r4 == 0) goto L17; */ /* JADX WARN: Code restructure failed: missing block: B:16:0x002f, code lost: r0 = new java.lang.StringBuilder("Expected leading [0-9] or '-' character but was 0x"); r1 = java.lang.Integer.toString(r8, kotlin.text.CharsKt.checkRadix(kotlin.text.CharsKt.checkRadix(16))); kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r1, "java.lang.Integer.toStri…(this, checkRadix(radix))"); */ /* JADX WARN: Code restructure failed: missing block: B:17:0x0058, code lost: throw new java.lang.NumberFormatException(r0.append(r1).toString()); */ @Override // okio.BufferedSource /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public long readDecimalLong() { /* r10 = this; r0 = 1 r10.require(r0) r2 = 0 r4 = r2 L8: long r6 = r4 + r0 boolean r8 = r10.request(r6) if (r8 == 0) goto L59 okio.Buffer r8 = r10.bufferField byte r8 = r8.getByte(r4) r9 = 48 byte r9 = (byte) r9 if (r8 < r9) goto L20 r9 = 57 byte r9 = (byte) r9 if (r8 <= r9) goto L2a L20: int r4 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1)) if (r4 != 0) goto L2c r5 = 45 byte r5 = (byte) r5 if (r8 == r5) goto L2a goto L2c L2a: r4 = r6 goto L8 L2c: if (r4 == 0) goto L2f goto L59 L2f: java.lang.NumberFormatException r10 = new java.lang.NumberFormatException java.lang.StringBuilder r0 = new java.lang.StringBuilder java.lang.String r1 = "Expected leading [0-9] or '-' character but was 0x" r0.(r1) r1 = 16 int r1 = kotlin.text.CharsKt.checkRadix(r1) int r1 = kotlin.text.CharsKt.checkRadix(r1) java.lang.String r1 = java.lang.Integer.toString(r8, r1) java.lang.String r2 = "java.lang.Integer.toStri…(this, checkRadix(radix))" kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r1, r2) java.lang.StringBuilder r0 = r0.append(r1) java.lang.String r0 = r0.toString() r10.(r0) java.lang.Throwable r10 = (java.lang.Throwable) r10 throw r10 L59: okio.Buffer r10 = r10.bufferField long r0 = r10.readDecimalLong() return r0 */ throw new UnsupportedOperationException("Method not decompiled: okio.RealBufferedSource.readDecimalLong():long"); } @Override // okio.BufferedSource public long readHexadecimalUnsignedLong() { byte b; require(1L); int i = 0; while (true) { int i2 = i + 1; if (!request(i2)) { break; } b = this.bufferField.getByte(i); if ((b < ((byte) 48) || b > ((byte) 57)) && ((b < ((byte) 97) || b > ((byte) LocationRequestCompat.QUALITY_BALANCED_POWER_ACCURACY)) && (b < ((byte) 65) || b > ((byte) 70)))) { break; } i = i2; } if (i == 0) { StringBuilder sb = new StringBuilder("Expected leading [0-9a-fA-F] character but was 0x"); String num = Integer.toString(b, CharsKt.checkRadix(CharsKt.checkRadix(16))); Intrinsics.checkNotNullExpressionValue(num, "java.lang.Integer.toStri…(this, checkRadix(radix))"); throw new NumberFormatException(sb.append(num).toString()); } return this.bufferField.readHexadecimalUnsignedLong(); } @Override // okio.BufferedSource public void skip(long byteCount) { if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } while (byteCount > 0) { if (this.bufferField.size() == 0 && this.source.read(this.bufferField, 8192) == -1) { throw new EOFException(); } long min = Math.min(byteCount, this.bufferField.size()); this.bufferField.skip(min); byteCount -= min; } } @Override // okio.BufferedSource public long indexOf(byte b, long fromIndex, long toIndex) { if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } if (!(0 <= fromIndex && toIndex >= fromIndex)) { throw new IllegalArgumentException(("fromIndex=" + fromIndex + " toIndex=" + toIndex).toString()); } while (fromIndex < toIndex) { long indexOf = this.bufferField.indexOf(b, fromIndex, toIndex); if (indexOf != -1) { return indexOf; } long size = this.bufferField.size(); if (size >= toIndex || this.source.read(this.bufferField, 8192) == -1) { return -1L; } fromIndex = Math.max(fromIndex, size); } return -1L; } @Override // okio.BufferedSource public long indexOf(ByteString bytes, long fromIndex) { Intrinsics.checkNotNullParameter(bytes, "bytes"); if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } while (true) { long indexOf = this.bufferField.indexOf(bytes, fromIndex); if (indexOf != -1) { return indexOf; } long size = this.bufferField.size(); if (this.source.read(this.bufferField, 8192) == -1) { return -1L; } fromIndex = Math.max(fromIndex, (size - bytes.size()) + 1); } } @Override // okio.BufferedSource public long indexOfElement(ByteString targetBytes, long fromIndex) { Intrinsics.checkNotNullParameter(targetBytes, "targetBytes"); if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } while (true) { long indexOfElement = this.bufferField.indexOfElement(targetBytes, fromIndex); if (indexOfElement != -1) { return indexOfElement; } long size = this.bufferField.size(); if (this.source.read(this.bufferField, 8192) == -1) { return -1L; } fromIndex = Math.max(fromIndex, size); } } @Override // okio.BufferedSource public boolean rangeEquals(long offset, ByteString bytes, int bytesOffset, int byteCount) { int i; Intrinsics.checkNotNullParameter(bytes, "bytes"); if (!(!this.closed)) { throw new IllegalStateException("closed".toString()); } if (offset >= 0 && bytesOffset >= 0 && byteCount >= 0 && bytes.size() - bytesOffset >= byteCount) { for (0; i < byteCount; i + 1) { long j = i + offset; i = (request(1 + j) && this.bufferField.getByte(j) == bytes.getByte(bytesOffset + i)) ? i + 1 : 0; } return true; } return false; } @Override // okio.BufferedSource public BufferedSource peek() { return Okio.buffer(new PeekSource(this)); } @Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable public void close() { if (this.closed) { return; } this.closed = true; this.source.close(); this.bufferField.clear(); } @Override // okio.Source /* renamed from: timeout */ public Timeout getTimeout() { return this.source.getTimeout(); } public String toString() { return "buffer(" + this.source + ')'; } }