mirror of
https://github.com/FuzzingLabs/fuzzforge_ai.git
synced 2026-08-12 16:20:23 +02:00
first commit
This commit is contained in:
@@ -0,0 +1,418 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: AsyncTimeout.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0016\u0018\u0000 \u001b2\u00020\u0001:\u0002\u001b\u001cB\u0005¢\u0006\u0002\u0010\u0002J\u0012\u0010\b\u001a\u00020\t2\b\u0010\n\u001a\u0004\u0018\u00010\tH\u0001J\u0006\u0010\u000b\u001a\u00020\fJ\u0006\u0010\r\u001a\u00020\u0004J\u0012\u0010\u000e\u001a\u00020\t2\b\u0010\n\u001a\u0004\u0018\u00010\tH\u0014J\u0010\u0010\u000f\u001a\u00020\u00072\u0006\u0010\u0010\u001a\u00020\u0007H\u0002J\u000e\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0011\u001a\u00020\u0012J\u000e\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0013\u001a\u00020\u0014J\b\u0010\u0015\u001a\u00020\fH\u0014J%\u0010\u0016\u001a\u0002H\u0017\"\u0004\b\u0000\u0010\u00172\f\u0010\u0018\u001a\b\u0012\u0004\u0012\u0002H\u00170\u0019H\u0086\bø\u0001\u0000¢\u0006\u0002\u0010\u001aR\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0000X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u000e¢\u0006\u0002\n\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u001d"}, m238d2 = {"Lokio/AsyncTimeout;", "Lokio/Timeout;", "()V", "inQueue", "", "next", "timeoutAt", "", "access$newTimeoutException", "Ljava/io/IOException;", "cause", "enter", "", "exit", "newTimeoutException", "remainingNanos", "now", "sink", "Lokio/Sink;", "source", "Lokio/Source;", "timedOut", "withTimeout", "T", "block", "Lkotlin/Function0;", "(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "Companion", "Watchdog", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public class AsyncTimeout extends Timeout {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private static final long IDLE_TIMEOUT_MILLIS;
|
||||
private static final long IDLE_TIMEOUT_NANOS;
|
||||
private static final int TIMEOUT_WRITE_SIZE = 65536;
|
||||
private static AsyncTimeout head;
|
||||
private boolean inQueue;
|
||||
private AsyncTimeout next;
|
||||
private long timeoutAt;
|
||||
|
||||
public final void enter() {
|
||||
if (!(!this.inQueue)) {
|
||||
throw new IllegalStateException("Unbalanced enter/exit".toString());
|
||||
}
|
||||
long timeoutNanos = getTimeoutNanos();
|
||||
boolean hasDeadline = getHasDeadline();
|
||||
if (timeoutNanos == 0 && !hasDeadline) {
|
||||
return;
|
||||
}
|
||||
this.inQueue = true;
|
||||
INSTANCE.scheduleTimeout(this, timeoutNanos, hasDeadline);
|
||||
}
|
||||
|
||||
public final boolean exit() {
|
||||
if (!this.inQueue) {
|
||||
return false;
|
||||
}
|
||||
this.inQueue = false;
|
||||
return INSTANCE.cancelScheduledTimeout(this);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final long remainingNanos(long now) {
|
||||
return this.timeoutAt - now;
|
||||
}
|
||||
|
||||
protected void timedOut() {
|
||||
}
|
||||
|
||||
public final Sink sink(final Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return new Sink() { // from class: okio.AsyncTimeout$sink$1
|
||||
@Override // okio.Sink
|
||||
public void write(Buffer source, long byteCount) {
|
||||
long toWrite;
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Util.checkOffsetAndCount(source.size(), 0L, byteCount);
|
||||
for (long remaining = byteCount; remaining > 0; remaining -= toWrite) {
|
||||
toWrite = 0;
|
||||
Segment s = source.head;
|
||||
Intrinsics.checkNotNull(s);
|
||||
while (true) {
|
||||
if (toWrite >= 65536) {
|
||||
break;
|
||||
}
|
||||
int segmentSize = s.limit - s.pos;
|
||||
toWrite += segmentSize;
|
||||
if (toWrite >= remaining) {
|
||||
toWrite = remaining;
|
||||
break;
|
||||
} else {
|
||||
Segment segment = s.next;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
s = segment;
|
||||
}
|
||||
}
|
||||
AsyncTimeout this_$iv = AsyncTimeout.this;
|
||||
this_$iv.enter();
|
||||
try {
|
||||
try {
|
||||
sink.write(source, toWrite);
|
||||
Unit unit = Unit.INSTANCE;
|
||||
boolean timedOut$iv = this_$iv.exit();
|
||||
if (timedOut$iv) {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
} catch (IOException e$iv) {
|
||||
if (!this_$iv.exit()) {
|
||||
throw e$iv;
|
||||
}
|
||||
throw this_$iv.access$newTimeoutException(e$iv);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
boolean timedOut$iv2 = this_$iv.exit();
|
||||
if (timedOut$iv2 && 0 != 0) {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
public void flush() {
|
||||
AsyncTimeout this_$iv = AsyncTimeout.this;
|
||||
this_$iv.enter();
|
||||
try {
|
||||
try {
|
||||
sink.flush();
|
||||
Unit unit = Unit.INSTANCE;
|
||||
boolean timedOut$iv = this_$iv.exit();
|
||||
if (!timedOut$iv) {
|
||||
} else {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
} catch (IOException e$iv) {
|
||||
if (!this_$iv.exit()) {
|
||||
throw e$iv;
|
||||
}
|
||||
throw this_$iv.access$newTimeoutException(e$iv);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
boolean timedOut$iv2 = this_$iv.exit();
|
||||
if (timedOut$iv2 && 0 != 0) {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
AsyncTimeout this_$iv = AsyncTimeout.this;
|
||||
this_$iv.enter();
|
||||
try {
|
||||
try {
|
||||
sink.close();
|
||||
Unit unit = Unit.INSTANCE;
|
||||
boolean timedOut$iv = this_$iv.exit();
|
||||
if (!timedOut$iv) {
|
||||
} else {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
} catch (IOException e$iv) {
|
||||
if (!this_$iv.exit()) {
|
||||
throw e$iv;
|
||||
}
|
||||
throw this_$iv.access$newTimeoutException(e$iv);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
boolean timedOut$iv2 = this_$iv.exit();
|
||||
if (timedOut$iv2 && 0 != 0) {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
/* renamed from: timeout, reason: from getter */
|
||||
public AsyncTimeout getThis$0() {
|
||||
return AsyncTimeout.this;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AsyncTimeout.sink(" + sink + ')';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public final Source source(final Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new Source() { // from class: okio.AsyncTimeout$source$1
|
||||
@Override // okio.Source
|
||||
public long read(Buffer sink, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
AsyncTimeout this_$iv = AsyncTimeout.this;
|
||||
this_$iv.enter();
|
||||
try {
|
||||
try {
|
||||
long result$iv = source.read(sink, byteCount);
|
||||
boolean timedOut$iv = this_$iv.exit();
|
||||
if (!timedOut$iv) {
|
||||
return result$iv;
|
||||
}
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
} catch (IOException e$iv) {
|
||||
if (this_$iv.exit()) {
|
||||
throw this_$iv.access$newTimeoutException(e$iv);
|
||||
}
|
||||
throw e$iv;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
boolean timedOut$iv2 = this_$iv.exit();
|
||||
if (!timedOut$iv2 || 0 == 0) {
|
||||
throw th;
|
||||
}
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
AsyncTimeout this_$iv = AsyncTimeout.this;
|
||||
this_$iv.enter();
|
||||
try {
|
||||
try {
|
||||
source.close();
|
||||
Unit unit = Unit.INSTANCE;
|
||||
boolean timedOut$iv = this_$iv.exit();
|
||||
if (!timedOut$iv) {
|
||||
} else {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
} catch (IOException e$iv) {
|
||||
if (!this_$iv.exit()) {
|
||||
throw e$iv;
|
||||
}
|
||||
throw this_$iv.access$newTimeoutException(e$iv);
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
boolean timedOut$iv2 = this_$iv.exit();
|
||||
if (timedOut$iv2 && 0 != 0) {
|
||||
throw this_$iv.access$newTimeoutException(null);
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
/* renamed from: timeout, reason: from getter */
|
||||
public AsyncTimeout getThis$0() {
|
||||
return AsyncTimeout.this;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "AsyncTimeout.source(" + source + ')';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public final <T> T withTimeout(Function0<? extends T> block) {
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
enter();
|
||||
try {
|
||||
try {
|
||||
T invoke = block.invoke();
|
||||
InlineMarker.finallyStart(1);
|
||||
boolean timedOut = exit();
|
||||
if (!timedOut) {
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
}
|
||||
throw access$newTimeoutException(null);
|
||||
} catch (IOException e) {
|
||||
if (exit()) {
|
||||
throw access$newTimeoutException(e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
InlineMarker.finallyStart(1);
|
||||
boolean timedOut2 = exit();
|
||||
if (timedOut2 && 0 != 0) {
|
||||
throw access$newTimeoutException(null);
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
|
||||
public final IOException access$newTimeoutException(IOException cause) {
|
||||
return newTimeoutException(cause);
|
||||
}
|
||||
|
||||
protected IOException newTimeoutException(IOException cause) {
|
||||
InterruptedIOException e = new InterruptedIOException("timeout");
|
||||
if (cause != null) {
|
||||
e.initCause(cause);
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
||||
/* compiled from: AsyncTimeout.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0000¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016¨\u0006\u0005"}, m238d2 = {"Lokio/AsyncTimeout$Watchdog;", "Ljava/lang/Thread;", "()V", "run", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
private static final class Watchdog extends Thread {
|
||||
public Watchdog() {
|
||||
super("Okio Watchdog");
|
||||
setDaemon(true);
|
||||
}
|
||||
|
||||
@Override // java.lang.Thread, java.lang.Runnable
|
||||
public void run() {
|
||||
AsyncTimeout awaitTimeout$okio;
|
||||
while (true) {
|
||||
try {
|
||||
synchronized (AsyncTimeout.class) {
|
||||
awaitTimeout$okio = AsyncTimeout.INSTANCE.awaitTimeout$okio();
|
||||
if (awaitTimeout$okio == AsyncTimeout.head) {
|
||||
AsyncTimeout.head = null;
|
||||
return;
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
if (awaitTimeout$okio != null) {
|
||||
awaitTimeout$okio.timedOut();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: AsyncTimeout.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000f\u0010\n\u001a\u0004\u0018\u00010\tH\u0000¢\u0006\u0002\b\u000bJ\u0010\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\tH\u0002J \u0010\u000f\u001a\u00020\u00102\u0006\u0010\u000e\u001a\u00020\t2\u0006\u0010\u0011\u001a\u00020\u00042\u0006\u0010\u0012\u001a\u00020\rH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082T¢\u0006\u0002\n\u0000R\u0010\u0010\b\u001a\u0004\u0018\u00010\tX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0013"}, m238d2 = {"Lokio/AsyncTimeout$Companion;", "", "()V", "IDLE_TIMEOUT_MILLIS", "", "IDLE_TIMEOUT_NANOS", "TIMEOUT_WRITE_SIZE", "", "head", "Lokio/AsyncTimeout;", "awaitTimeout", "awaitTimeout$okio", "cancelScheduledTimeout", "", "node", "scheduleTimeout", "", "timeoutNanos", "hasDeadline", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
public static final class Companion {
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
|
||||
this();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void scheduleTimeout(AsyncTimeout node, long timeoutNanos, boolean hasDeadline) {
|
||||
synchronized (AsyncTimeout.class) {
|
||||
if (AsyncTimeout.head == null) {
|
||||
AsyncTimeout.head = new AsyncTimeout();
|
||||
new Watchdog().start();
|
||||
}
|
||||
long now = System.nanoTime();
|
||||
if (timeoutNanos != 0 && hasDeadline) {
|
||||
node.timeoutAt = Math.min(timeoutNanos, node.deadlineNanoTime() - now) + now;
|
||||
} else if (timeoutNanos != 0) {
|
||||
node.timeoutAt = now + timeoutNanos;
|
||||
} else if (hasDeadline) {
|
||||
node.timeoutAt = node.deadlineNanoTime();
|
||||
} else {
|
||||
throw new AssertionError();
|
||||
}
|
||||
long remainingNanos = node.remainingNanos(now);
|
||||
AsyncTimeout prev = AsyncTimeout.head;
|
||||
Intrinsics.checkNotNull(prev);
|
||||
while (prev.next != null) {
|
||||
AsyncTimeout asyncTimeout = prev.next;
|
||||
Intrinsics.checkNotNull(asyncTimeout);
|
||||
if (remainingNanos < asyncTimeout.remainingNanos(now)) {
|
||||
break;
|
||||
}
|
||||
AsyncTimeout asyncTimeout2 = prev.next;
|
||||
Intrinsics.checkNotNull(asyncTimeout2);
|
||||
prev = asyncTimeout2;
|
||||
}
|
||||
node.next = prev.next;
|
||||
prev.next = node;
|
||||
if (prev == AsyncTimeout.head) {
|
||||
AsyncTimeout.class.notify();
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final boolean cancelScheduledTimeout(AsyncTimeout node) {
|
||||
synchronized (AsyncTimeout.class) {
|
||||
for (AsyncTimeout prev = AsyncTimeout.head; prev != null; prev = prev.next) {
|
||||
if (prev.next == node) {
|
||||
prev.next = node.next;
|
||||
node.next = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public final AsyncTimeout awaitTimeout$okio() throws InterruptedException {
|
||||
AsyncTimeout asyncTimeout = AsyncTimeout.head;
|
||||
Intrinsics.checkNotNull(asyncTimeout);
|
||||
AsyncTimeout node = asyncTimeout.next;
|
||||
if (node == null) {
|
||||
long startNanos = System.nanoTime();
|
||||
AsyncTimeout.class.wait(AsyncTimeout.IDLE_TIMEOUT_MILLIS);
|
||||
AsyncTimeout asyncTimeout2 = AsyncTimeout.head;
|
||||
Intrinsics.checkNotNull(asyncTimeout2);
|
||||
if (asyncTimeout2.next == null && System.nanoTime() - startNanos >= AsyncTimeout.IDLE_TIMEOUT_NANOS) {
|
||||
return AsyncTimeout.head;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
long startNanos2 = System.nanoTime();
|
||||
long waitNanos = node.remainingNanos(startNanos2);
|
||||
if (waitNanos <= 0) {
|
||||
AsyncTimeout asyncTimeout3 = AsyncTimeout.head;
|
||||
Intrinsics.checkNotNull(asyncTimeout3);
|
||||
asyncTimeout3.next = node.next;
|
||||
node.next = null;
|
||||
return node;
|
||||
}
|
||||
long waitMillis = waitNanos / 1000000;
|
||||
AsyncTimeout.class.wait(waitMillis, (int) (waitNanos - (1000000 * waitMillis)));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
long millis = TimeUnit.SECONDS.toMillis(60L);
|
||||
IDLE_TIMEOUT_MILLIS = millis;
|
||||
IDLE_TIMEOUT_NANOS = TimeUnit.MILLISECONDS.toNanos(millis);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package okio;
|
||||
|
||||
import java.util.Arrays;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: -Base64.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0003\u001a\u000e\u0010\u0006\u001a\u0004\u0018\u00010\u0001*\u00020\u0007H\u0000\u001a\u0016\u0010\b\u001a\u00020\u0007*\u00020\u00012\b\b\u0002\u0010\t\u001a\u00020\u0001H\u0000\"\u0014\u0010\u0000\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003\"\u0014\u0010\u0004\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0003¨\u0006\n"}, m238d2 = {"BASE64", "", "getBASE64", "()[B", "BASE64_URL_SAFE", "getBASE64_URL_SAFE", "decodeBase64ToArray", "", "encodeBase64", "map", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-Base64, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Base64 {
|
||||
private static final byte[] BASE64 = ByteString.Companion.encodeUtf8("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").getData$okio();
|
||||
private static final byte[] BASE64_URL_SAFE = ByteString.Companion.encodeUtf8("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_").getData$okio();
|
||||
|
||||
public static final byte[] getBASE64() {
|
||||
return BASE64;
|
||||
}
|
||||
|
||||
public static final byte[] getBASE64_URL_SAFE() {
|
||||
return BASE64_URL_SAFE;
|
||||
}
|
||||
|
||||
public static final byte[] decodeBase64ToArray(String decodeBase64ToArray) {
|
||||
int bits;
|
||||
char c;
|
||||
Intrinsics.checkNotNullParameter(decodeBase64ToArray, "$this$decodeBase64ToArray");
|
||||
int limit = decodeBase64ToArray.length();
|
||||
while (limit > 0 && ((c = decodeBase64ToArray.charAt(limit - 1)) == '=' || c == '\n' || c == '\r' || c == ' ' || c == '\t')) {
|
||||
limit--;
|
||||
}
|
||||
byte[] out = new byte[(int) ((limit * 6) / 8)];
|
||||
int outCount = 0;
|
||||
int inCount = 0;
|
||||
int word = 0;
|
||||
for (int pos = 0; pos < limit; pos++) {
|
||||
char c2 = decodeBase64ToArray.charAt(pos);
|
||||
if ('A' <= c2 && 'Z' >= c2) {
|
||||
bits = c2 - 'A';
|
||||
} else if ('a' <= c2 && 'z' >= c2) {
|
||||
bits = c2 - 'G';
|
||||
} else if ('0' <= c2 && '9' >= c2) {
|
||||
bits = c2 + 4;
|
||||
} else if (c2 == '+' || c2 == '-') {
|
||||
bits = 62;
|
||||
} else if (c2 == '/' || c2 == '_') {
|
||||
bits = 63;
|
||||
} else {
|
||||
if (c2 != '\n' && c2 != '\r' && c2 != ' ' && c2 != '\t') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
word = (word << 6) | bits;
|
||||
inCount++;
|
||||
if (inCount % 4 == 0) {
|
||||
int outCount2 = outCount + 1;
|
||||
out[outCount] = (byte) (word >> 16);
|
||||
int outCount3 = outCount2 + 1;
|
||||
out[outCount2] = (byte) (word >> 8);
|
||||
out[outCount3] = (byte) word;
|
||||
outCount = outCount3 + 1;
|
||||
}
|
||||
}
|
||||
int lastWordChars = inCount % 4;
|
||||
switch (lastWordChars) {
|
||||
case 1:
|
||||
return null;
|
||||
case 2:
|
||||
out[outCount] = (byte) ((word << 12) >> 16);
|
||||
outCount++;
|
||||
break;
|
||||
case 3:
|
||||
int word2 = word << 6;
|
||||
int outCount4 = outCount + 1;
|
||||
out[outCount] = (byte) (word2 >> 16);
|
||||
outCount = outCount4 + 1;
|
||||
out[outCount4] = (byte) (word2 >> 8);
|
||||
break;
|
||||
}
|
||||
if (outCount == out.length) {
|
||||
return out;
|
||||
}
|
||||
byte[] copyOf = Arrays.copyOf(out, outCount);
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, newSize)");
|
||||
return copyOf;
|
||||
}
|
||||
|
||||
public static /* synthetic */ String encodeBase64$default(byte[] bArr, byte[] bArr2, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
bArr2 = BASE64;
|
||||
}
|
||||
return encodeBase64(bArr, bArr2);
|
||||
}
|
||||
|
||||
public static final String encodeBase64(byte[] encodeBase64, byte[] map) {
|
||||
Intrinsics.checkNotNullParameter(encodeBase64, "$this$encodeBase64");
|
||||
Intrinsics.checkNotNullParameter(map, "map");
|
||||
int length = ((encodeBase64.length + 2) / 3) * 4;
|
||||
byte[] out = new byte[length];
|
||||
int index = 0;
|
||||
int end = encodeBase64.length - (encodeBase64.length % 3);
|
||||
int b0 = 0;
|
||||
while (b0 < end) {
|
||||
int i = b0 + 1;
|
||||
int b02 = encodeBase64[b0];
|
||||
int i2 = i + 1;
|
||||
int b1 = encodeBase64[i];
|
||||
int i3 = i2 + 1;
|
||||
int b2 = encodeBase64[i2];
|
||||
int index2 = index + 1;
|
||||
out[index] = map[(b02 & 255) >> 2];
|
||||
int index3 = index2 + 1;
|
||||
out[index2] = map[((b02 & 3) << 4) | ((b1 & 255) >> 4)];
|
||||
int index4 = index3 + 1;
|
||||
out[index3] = map[((b1 & 15) << 2) | ((b2 & 255) >> 6)];
|
||||
index = index4 + 1;
|
||||
out[index4] = map[b2 & 63];
|
||||
b0 = i3;
|
||||
}
|
||||
switch (encodeBase64.length - end) {
|
||||
case 1:
|
||||
int i4 = encodeBase64[b0];
|
||||
int index5 = index + 1;
|
||||
out[index] = map[(i4 & 255) >> 2];
|
||||
int index6 = index5 + 1;
|
||||
out[index5] = map[(i4 & 3) << 4];
|
||||
byte b = (byte) 61;
|
||||
out[index6] = b;
|
||||
out[index6 + 1] = b;
|
||||
break;
|
||||
case 2:
|
||||
int i5 = b0 + 1;
|
||||
int b03 = encodeBase64[b0];
|
||||
int b12 = encodeBase64[i5];
|
||||
int index7 = index + 1;
|
||||
out[index] = map[(b03 & 255) >> 2];
|
||||
int index8 = index7 + 1;
|
||||
out[index7] = map[((b03 & 3) << 4) | ((b12 & 255) >> 4)];
|
||||
out[index8] = map[(b12 & 15) << 2];
|
||||
out[index8 + 1] = (byte) 61;
|
||||
break;
|
||||
}
|
||||
return Platform.toUtf8String(out);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package okio;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Okio.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0003\u001a\u00020\u0004H\u0016J\b\u0010\u0005\u001a\u00020\u0004H\u0016J\b\u0010\u0006\u001a\u00020\u0007H\u0016J\u0018\u0010\b\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0016¨\u0006\r"}, m238d2 = {"Lokio/BlackholeSink;", "Lokio/Sink;", "()V", "close", "", "flush", "timeout", "Lokio/Timeout;", "write", "source", "Lokio/Buffer;", "byteCount", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
final class BlackholeSink implements Sink {
|
||||
@Override // okio.Sink
|
||||
public void write(Buffer source, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
source.skip(byteCount);
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
public void flush() {
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
/* renamed from: timeout */
|
||||
public Timeout getTimeout() {
|
||||
return Timeout.NONE;
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,71 @@
|
||||
package okio;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.channels.WritableByteChannel;
|
||||
import java.nio.charset.Charset;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
|
||||
/* compiled from: BufferedSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\t\n\u0002\b\u0010\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\bf\u0018\u00002\u00020\u00012\u00020\u0002J\b\u0010\u0003\u001a\u00020\u0004H'J\b\u0010\u0007\u001a\u00020\u0000H&J\b\u0010\b\u001a\u00020\u0000H&J\b\u0010\t\u001a\u00020\nH&J\b\u0010\u000b\u001a\u00020\fH&J\u0010\u0010\r\u001a\u00020\u00002\u0006\u0010\u000e\u001a\u00020\u000fH&J \u0010\r\u001a\u00020\u00002\u0006\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H&J\u0010\u0010\r\u001a\u00020\u00002\u0006\u0010\u0013\u001a\u00020\u0014H&J \u0010\r\u001a\u00020\u00002\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H&J\u0018\u0010\r\u001a\u00020\u00002\u0006\u0010\u000e\u001a\u00020\u00152\u0006\u0010\u0012\u001a\u00020\u0016H&J\u0010\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u000e\u001a\u00020\u0015H&J\u0010\u0010\u0018\u001a\u00020\u00002\u0006\u0010\u0019\u001a\u00020\u0011H&J\u0010\u0010\u001a\u001a\u00020\u00002\u0006\u0010\u001b\u001a\u00020\u0016H&J\u0010\u0010\u001c\u001a\u00020\u00002\u0006\u0010\u001b\u001a\u00020\u0016H&J\u0010\u0010\u001d\u001a\u00020\u00002\u0006\u0010\u001e\u001a\u00020\u0011H&J\u0010\u0010\u001f\u001a\u00020\u00002\u0006\u0010\u001e\u001a\u00020\u0011H&J\u0010\u0010 \u001a\u00020\u00002\u0006\u0010\u001b\u001a\u00020\u0016H&J\u0010\u0010!\u001a\u00020\u00002\u0006\u0010\u001b\u001a\u00020\u0016H&J\u0010\u0010\"\u001a\u00020\u00002\u0006\u0010#\u001a\u00020\u0011H&J\u0010\u0010$\u001a\u00020\u00002\u0006\u0010#\u001a\u00020\u0011H&J\u0018\u0010%\u001a\u00020\u00002\u0006\u0010&\u001a\u00020'2\u0006\u0010(\u001a\u00020)H&J(\u0010%\u001a\u00020\u00002\u0006\u0010&\u001a\u00020'2\u0006\u0010*\u001a\u00020\u00112\u0006\u0010+\u001a\u00020\u00112\u0006\u0010(\u001a\u00020)H&J\u0010\u0010,\u001a\u00020\u00002\u0006\u0010&\u001a\u00020'H&J \u0010,\u001a\u00020\u00002\u0006\u0010&\u001a\u00020'2\u0006\u0010*\u001a\u00020\u00112\u0006\u0010+\u001a\u00020\u0011H&J\u0010\u0010-\u001a\u00020\u00002\u0006\u0010.\u001a\u00020\u0011H&R\u0012\u0010\u0003\u001a\u00020\u0004X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006/"}, m238d2 = {"Lokio/BufferedSink;", "Lokio/Sink;", "Ljava/nio/channels/WritableByteChannel;", "buffer", "Lokio/Buffer;", "getBuffer", "()Lokio/Buffer;", "emit", "emitCompleteSegments", "flush", "", "outputStream", "Ljava/io/OutputStream;", "write", "source", "", TypedValues.Cycle.S_WAVE_OFFSET, "", "byteCount", "byteString", "Lokio/ByteString;", "Lokio/Source;", "", "writeAll", "writeByte", "b", "writeDecimalLong", "v", "writeHexadecimalUnsignedLong", "writeInt", "i", "writeIntLe", "writeLong", "writeLongLe", "writeShort", "s", "writeShortLe", "writeString", TypedValues.Custom.S_STRING, "", "charset", "Ljava/nio/charset/Charset;", "beginIndex", "endIndex", "writeUtf8", "writeUtf8CodePoint", "codePoint", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public interface BufferedSink extends Sink, WritableByteChannel {
|
||||
@Deprecated(level = DeprecationLevel.WARNING, message = "moved to val: use getBuffer() instead", replaceWith = @ReplaceWith(expression = "buffer", imports = {}))
|
||||
/* renamed from: buffer */
|
||||
Buffer getBufferField();
|
||||
|
||||
BufferedSink emit() throws IOException;
|
||||
|
||||
BufferedSink emitCompleteSegments() throws IOException;
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
void flush() throws IOException;
|
||||
|
||||
Buffer getBuffer();
|
||||
|
||||
OutputStream outputStream();
|
||||
|
||||
BufferedSink write(ByteString byteString) throws IOException;
|
||||
|
||||
BufferedSink write(ByteString byteString, int offset, int byteCount) throws IOException;
|
||||
|
||||
BufferedSink write(Source source, long byteCount) throws IOException;
|
||||
|
||||
BufferedSink write(byte[] source) throws IOException;
|
||||
|
||||
BufferedSink write(byte[] source, int offset, int byteCount) throws IOException;
|
||||
|
||||
long writeAll(Source source) throws IOException;
|
||||
|
||||
BufferedSink writeByte(int b) throws IOException;
|
||||
|
||||
BufferedSink writeDecimalLong(long v) throws IOException;
|
||||
|
||||
BufferedSink writeHexadecimalUnsignedLong(long v) throws IOException;
|
||||
|
||||
BufferedSink writeInt(int i) throws IOException;
|
||||
|
||||
BufferedSink writeIntLe(int i) throws IOException;
|
||||
|
||||
BufferedSink writeLong(long v) throws IOException;
|
||||
|
||||
BufferedSink writeLongLe(long v) throws IOException;
|
||||
|
||||
BufferedSink writeShort(int s) throws IOException;
|
||||
|
||||
BufferedSink writeShortLe(int s) throws IOException;
|
||||
|
||||
BufferedSink writeString(String string, int beginIndex, int endIndex, Charset charset) throws IOException;
|
||||
|
||||
BufferedSink writeString(String string, Charset charset) throws IOException;
|
||||
|
||||
BufferedSink writeUtf8(String string) throws IOException;
|
||||
|
||||
BufferedSink writeUtf8(String string, int beginIndex, int endIndex) throws IOException;
|
||||
|
||||
BufferedSink writeUtf8CodePoint(int codePoint) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package okio;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.nio.charset.Charset;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
|
||||
/* compiled from: BufferedSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000v\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\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\u0004\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0012\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0006\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\bf\u0018\u00002\u00020\u00012\u00020\u0002J\b\u0010\u0003\u001a\u00020\u0004H'J\b\u0010\u0007\u001a\u00020\bH&J\u0010\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH&J\u0018\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\nH&J \u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\n2\u0006\u0010\u000e\u001a\u00020\nH&J\u0010\u0010\t\u001a\u00020\n2\u0006\u0010\u000f\u001a\u00020\u0010H&J\u0018\u0010\t\u001a\u00020\n2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\r\u001a\u00020\nH&J\u0010\u0010\u0011\u001a\u00020\n2\u0006\u0010\u0012\u001a\u00020\u0010H&J\u0018\u0010\u0011\u001a\u00020\n2\u0006\u0010\u0012\u001a\u00020\u00102\u0006\u0010\r\u001a\u00020\nH&J\b\u0010\u0013\u001a\u00020\u0014H&J\b\u0010\u0015\u001a\u00020\u0000H&J\u0018\u0010\u0016\u001a\u00020\b2\u0006\u0010\u0017\u001a\u00020\n2\u0006\u0010\u000f\u001a\u00020\u0010H&J(\u0010\u0016\u001a\u00020\b2\u0006\u0010\u0017\u001a\u00020\n2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0018\u001a\u00020\u00192\u0006\u0010\u001a\u001a\u00020\u0019H&J\u0010\u0010\u001b\u001a\u00020\u00192\u0006\u0010\u001c\u001a\u00020\u001dH&J \u0010\u001b\u001a\u00020\u00192\u0006\u0010\u001c\u001a\u00020\u001d2\u0006\u0010\u0017\u001a\u00020\u00192\u0006\u0010\u001a\u001a\u00020\u0019H&J\u0010\u0010\u001e\u001a\u00020\n2\u0006\u0010\u001c\u001a\u00020\u001fH&J\b\u0010 \u001a\u00020\fH&J\b\u0010!\u001a\u00020\u001dH&J\u0010\u0010!\u001a\u00020\u001d2\u0006\u0010\u001a\u001a\u00020\nH&J\b\u0010\"\u001a\u00020\u0010H&J\u0010\u0010\"\u001a\u00020\u00102\u0006\u0010\u001a\u001a\u00020\nH&J\b\u0010#\u001a\u00020\nH&J\u0010\u0010$\u001a\u00020%2\u0006\u0010\u001c\u001a\u00020\u001dH&J\u0018\u0010$\u001a\u00020%2\u0006\u0010\u001c\u001a\u00020\u00042\u0006\u0010\u001a\u001a\u00020\nH&J\b\u0010&\u001a\u00020\nH&J\b\u0010'\u001a\u00020\u0019H&J\b\u0010(\u001a\u00020\u0019H&J\b\u0010)\u001a\u00020\nH&J\b\u0010*\u001a\u00020\nH&J\b\u0010+\u001a\u00020,H&J\b\u0010-\u001a\u00020,H&J\u0010\u0010.\u001a\u00020/2\u0006\u00100\u001a\u000201H&J\u0018\u0010.\u001a\u00020/2\u0006\u0010\u001a\u001a\u00020\n2\u0006\u00100\u001a\u000201H&J\b\u00102\u001a\u00020/H&J\u0010\u00102\u001a\u00020/2\u0006\u0010\u001a\u001a\u00020\nH&J\b\u00103\u001a\u00020\u0019H&J\n\u00104\u001a\u0004\u0018\u00010/H&J\b\u00105\u001a\u00020/H&J\u0010\u00105\u001a\u00020/2\u0006\u00106\u001a\u00020\nH&J\u0010\u00107\u001a\u00020\b2\u0006\u0010\u001a\u001a\u00020\nH&J\u0010\u00108\u001a\u00020%2\u0006\u0010\u001a\u001a\u00020\nH&J\u0010\u00109\u001a\u00020\u00192\u0006\u0010:\u001a\u00020;H&J\u0010\u0010<\u001a\u00020%2\u0006\u0010\u001a\u001a\u00020\nH&R\u0012\u0010\u0003\u001a\u00020\u0004X¦\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006¨\u0006="}, m238d2 = {"Lokio/BufferedSource;", "Lokio/Source;", "Ljava/nio/channels/ReadableByteChannel;", "buffer", "Lokio/Buffer;", "getBuffer", "()Lokio/Buffer;", "exhausted", "", "indexOf", "", "b", "", "fromIndex", "toIndex", "bytes", "Lokio/ByteString;", "indexOfElement", "targetBytes", "inputStream", "Ljava/io/InputStream;", "peek", "rangeEquals", TypedValues.Cycle.S_WAVE_OFFSET, "bytesOffset", "", "byteCount", "read", "sink", "", "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", "request", "require", "select", "options", "Lokio/Options;", "skip", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public interface BufferedSource extends Source, ReadableByteChannel {
|
||||
@Deprecated(level = DeprecationLevel.WARNING, message = "moved to val: use getBuffer() instead", replaceWith = @ReplaceWith(expression = "buffer", imports = {}))
|
||||
Buffer buffer();
|
||||
|
||||
boolean exhausted() throws IOException;
|
||||
|
||||
Buffer getBuffer();
|
||||
|
||||
long indexOf(byte b) throws IOException;
|
||||
|
||||
long indexOf(byte b, long fromIndex) throws IOException;
|
||||
|
||||
long indexOf(byte b, long fromIndex, long toIndex) throws IOException;
|
||||
|
||||
long indexOf(ByteString bytes) throws IOException;
|
||||
|
||||
long indexOf(ByteString bytes, long fromIndex) throws IOException;
|
||||
|
||||
long indexOfElement(ByteString targetBytes) throws IOException;
|
||||
|
||||
long indexOfElement(ByteString targetBytes, long fromIndex) throws IOException;
|
||||
|
||||
InputStream inputStream();
|
||||
|
||||
BufferedSource peek();
|
||||
|
||||
boolean rangeEquals(long offset, ByteString bytes) throws IOException;
|
||||
|
||||
boolean rangeEquals(long offset, ByteString bytes, int bytesOffset, int byteCount) throws IOException;
|
||||
|
||||
int read(byte[] sink) throws IOException;
|
||||
|
||||
int read(byte[] sink, int offset, int byteCount) throws IOException;
|
||||
|
||||
long readAll(Sink sink) throws IOException;
|
||||
|
||||
byte readByte() throws IOException;
|
||||
|
||||
byte[] readByteArray() throws IOException;
|
||||
|
||||
byte[] readByteArray(long byteCount) throws IOException;
|
||||
|
||||
ByteString readByteString() throws IOException;
|
||||
|
||||
ByteString readByteString(long byteCount) throws IOException;
|
||||
|
||||
long readDecimalLong() throws IOException;
|
||||
|
||||
void readFully(Buffer sink, long byteCount) throws IOException;
|
||||
|
||||
void readFully(byte[] sink) throws IOException;
|
||||
|
||||
long readHexadecimalUnsignedLong() throws IOException;
|
||||
|
||||
int readInt() throws IOException;
|
||||
|
||||
int readIntLe() throws IOException;
|
||||
|
||||
long readLong() throws IOException;
|
||||
|
||||
long readLongLe() throws IOException;
|
||||
|
||||
short readShort() throws IOException;
|
||||
|
||||
short readShortLe() throws IOException;
|
||||
|
||||
String readString(long byteCount, Charset charset) throws IOException;
|
||||
|
||||
String readString(Charset charset) throws IOException;
|
||||
|
||||
String readUtf8() throws IOException;
|
||||
|
||||
String readUtf8(long byteCount) throws IOException;
|
||||
|
||||
int readUtf8CodePoint() throws IOException;
|
||||
|
||||
String readUtf8Line() throws IOException;
|
||||
|
||||
String readUtf8LineStrict() throws IOException;
|
||||
|
||||
String readUtf8LineStrict(long limit) throws IOException;
|
||||
|
||||
boolean request(long byteCount) throws IOException;
|
||||
|
||||
void require(long byteCount) throws IOException;
|
||||
|
||||
int select(Options options) throws IOException;
|
||||
|
||||
void skip(long byteCount) throws IOException;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,126 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.zip.Deflater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: DeflaterSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\u0018\u00002\u00020\u0001B\u0017\b\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0001\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005B\u0017\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0006\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0007J\b\u0010\n\u001a\u00020\u000bH\u0016J\u0010\u0010\f\u001a\u00020\u000b2\u0006\u0010\r\u001a\u00020\tH\u0003J\r\u0010\u000e\u001a\u00020\u000bH\u0000¢\u0006\u0002\b\u000fJ\b\u0010\u0010\u001a\u00020\u000bH\u0016J\b\u0010\u0011\u001a\u00020\u0012H\u0016J\b\u0010\u0013\u001a\u00020\u0014H\u0016J\u0018\u0010\u0015\u001a\u00020\u000b2\u0006\u0010\u0016\u001a\u00020\u00172\u0006\u0010\u0018\u001a\u00020\u0019H\u0016R\u000e\u0010\b\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001a"}, m238d2 = {"Lokio/DeflaterSink;", "Lokio/Sink;", "sink", "deflater", "Ljava/util/zip/Deflater;", "(Lokio/Sink;Ljava/util/zip/Deflater;)V", "Lokio/BufferedSink;", "(Lokio/BufferedSink;Ljava/util/zip/Deflater;)V", "closed", "", "close", "", "deflate", "syncFlush", "finishDeflate", "finishDeflate$okio", "flush", "timeout", "Lokio/Timeout;", "toString", "", "write", "source", "Lokio/Buffer;", "byteCount", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class DeflaterSink implements Sink {
|
||||
private boolean closed;
|
||||
private final Deflater deflater;
|
||||
private final BufferedSink sink;
|
||||
|
||||
public DeflaterSink(BufferedSink sink, Deflater deflater) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Intrinsics.checkNotNullParameter(deflater, "deflater");
|
||||
this.sink = sink;
|
||||
this.deflater = deflater;
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public DeflaterSink(Sink sink, Deflater deflater) {
|
||||
this(Okio.buffer(sink), deflater);
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Intrinsics.checkNotNullParameter(deflater, "deflater");
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
public void write(Buffer source, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Util.checkOffsetAndCount(source.size(), 0L, byteCount);
|
||||
long remaining = byteCount;
|
||||
while (remaining > 0) {
|
||||
Segment head = source.head;
|
||||
Intrinsics.checkNotNull(head);
|
||||
int b$iv = (int) Math.min(remaining, head.limit - head.pos);
|
||||
this.deflater.setInput(head.data, head.pos, b$iv);
|
||||
deflate(false);
|
||||
source.setSize$okio(source.size() - b$iv);
|
||||
head.pos += b$iv;
|
||||
if (head.pos == head.limit) {
|
||||
source.head = head.pop();
|
||||
SegmentPool.recycle(head);
|
||||
}
|
||||
remaining -= b$iv;
|
||||
}
|
||||
}
|
||||
|
||||
private final void deflate(boolean syncFlush) {
|
||||
Segment s;
|
||||
int deflated;
|
||||
Buffer buffer = this.sink.getBuffer();
|
||||
while (true) {
|
||||
s = buffer.writableSegment$okio(1);
|
||||
if (syncFlush) {
|
||||
deflated = this.deflater.deflate(s.data, s.limit, 8192 - s.limit, 2);
|
||||
} else {
|
||||
deflated = this.deflater.deflate(s.data, s.limit, 8192 - s.limit);
|
||||
}
|
||||
if (deflated > 0) {
|
||||
s.limit += deflated;
|
||||
buffer.setSize$okio(buffer.size() + deflated);
|
||||
this.sink.emitCompleteSegments();
|
||||
} else if (this.deflater.needsInput()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (s.pos == s.limit) {
|
||||
buffer.head = s.pop();
|
||||
SegmentPool.recycle(s);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
public void flush() throws IOException {
|
||||
deflate(true);
|
||||
this.sink.flush();
|
||||
}
|
||||
|
||||
public final void finishDeflate$okio() {
|
||||
this.deflater.finish();
|
||||
deflate(false);
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
Throwable thrown = (Throwable) null;
|
||||
try {
|
||||
finishDeflate$okio();
|
||||
} catch (Throwable e) {
|
||||
thrown = e;
|
||||
}
|
||||
try {
|
||||
this.deflater.end();
|
||||
} catch (Throwable e2) {
|
||||
if (thrown == null) {
|
||||
thrown = e2;
|
||||
}
|
||||
}
|
||||
try {
|
||||
this.sink.close();
|
||||
} catch (Throwable e3) {
|
||||
if (thrown == null) {
|
||||
thrown = e3;
|
||||
}
|
||||
}
|
||||
this.closed = true;
|
||||
if (thrown != null) {
|
||||
throw thrown;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
public Timeout timeout() {
|
||||
return this.sink.timeout();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "DeflaterSink(" + this.sink + ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package okio;
|
||||
|
||||
import java.util.zip.Deflater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: DeflaterSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u0012\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0017\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\b\u0002\u0010\u0003\u001a\u00020\u0004H\u0086\b¨\u0006\u0005"}, m238d2 = {"deflate", "Lokio/DeflaterSink;", "Lokio/Sink;", "deflater", "Ljava/util/zip/Deflater;", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-DeflaterSinkExtensions, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class DeflaterSinkExtensions {
|
||||
public static /* synthetic */ DeflaterSink deflate$default(Sink deflate, Deflater deflater, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
deflater = new Deflater();
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(deflate, "$this$deflate");
|
||||
Intrinsics.checkNotNullParameter(deflater, "deflater");
|
||||
return new DeflaterSink(deflate, deflater);
|
||||
}
|
||||
|
||||
public static final DeflaterSink deflate(Sink deflate, Deflater deflater) {
|
||||
Intrinsics.checkNotNullParameter(deflate, "$this$deflate");
|
||||
Intrinsics.checkNotNullParameter(deflater, "deflater");
|
||||
return new DeflaterSink(deflate, deflater);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package okio;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.file.OpenOption;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: -DeprecatedOkio.kt */
|
||||
@Deprecated(message = "changed in Okio 2.x")
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000R\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\bÇ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\b\u0010\u0007\u001a\u00020\u0004H\u0007J\u0010\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u0004H\u0007J\u0010\u0010\b\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0007J\u0010\u0010\n\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\n\u001a\u00020\u00042\u0006\u0010\u000e\u001a\u00020\u000fH\u0007J\u0010\u0010\n\u001a\u00020\u00042\u0006\u0010\u0010\u001a\u00020\u0011H\u0007J)\u0010\n\u001a\u00020\u00042\u0006\u0010\u0012\u001a\u00020\u00132\u0012\u0010\u0014\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00160\u0015\"\u00020\u0016H\u0007¢\u0006\u0002\u0010\u0017J\u0010\u0010\f\u001a\u00020\r2\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\f\u001a\u00020\r2\u0006\u0010\u0018\u001a\u00020\u0019H\u0007J\u0010\u0010\f\u001a\u00020\r2\u0006\u0010\u0010\u001a\u00020\u0011H\u0007J)\u0010\f\u001a\u00020\r2\u0006\u0010\u0012\u001a\u00020\u00132\u0012\u0010\u0014\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00160\u0015\"\u00020\u0016H\u0007¢\u0006\u0002\u0010\u001a¨\u0006\u001b"}, m238d2 = {"Lokio/-DeprecatedOkio;", "", "()V", "appendingSink", "Lokio/Sink;", "file", "Ljava/io/File;", "blackhole", "buffer", "Lokio/BufferedSink;", "sink", "Lokio/BufferedSource;", "source", "Lokio/Source;", "outputStream", "Ljava/io/OutputStream;", "socket", "Ljava/net/Socket;", "path", "Ljava/nio/file/Path;", "options", "", "Ljava/nio/file/OpenOption;", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Lokio/Sink;", "inputStream", "Ljava/io/InputStream;", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Lokio/Source;", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-DeprecatedOkio, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class DeprecatedOkio {
|
||||
public static final DeprecatedOkio INSTANCE = new DeprecatedOkio();
|
||||
|
||||
private DeprecatedOkio() {
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "file.appendingSink()", imports = {"okio.appendingSink"}))
|
||||
public final Sink appendingSink(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
return Okio.appendingSink(file);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "sink.buffer()", imports = {"okio.buffer"}))
|
||||
public final BufferedSink buffer(Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return Okio.buffer(sink);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "source.buffer()", imports = {"okio.buffer"}))
|
||||
public final BufferedSource buffer(Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return Okio.buffer(source);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "file.sink()", imports = {"okio.sink"}))
|
||||
public final Sink sink(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
return Okio__JvmOkioKt.sink$default(file, false, 1, null);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "outputStream.sink()", imports = {"okio.sink"}))
|
||||
public final Sink sink(OutputStream outputStream) {
|
||||
Intrinsics.checkNotNullParameter(outputStream, "outputStream");
|
||||
return Okio.sink(outputStream);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "path.sink(*options)", imports = {"okio.sink"}))
|
||||
public final Sink sink(Path path, OpenOption... options) {
|
||||
Intrinsics.checkNotNullParameter(path, "path");
|
||||
Intrinsics.checkNotNullParameter(options, "options");
|
||||
return Okio.sink(path, (OpenOption[]) Arrays.copyOf(options, options.length));
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "socket.sink()", imports = {"okio.sink"}))
|
||||
public final Sink sink(Socket socket) {
|
||||
Intrinsics.checkNotNullParameter(socket, "socket");
|
||||
return Okio.sink(socket);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "file.source()", imports = {"okio.source"}))
|
||||
public final Source source(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
return Okio.source(file);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "inputStream.source()", imports = {"okio.source"}))
|
||||
public final Source source(InputStream inputStream) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "inputStream");
|
||||
return Okio.source(inputStream);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "path.source(*options)", imports = {"okio.source"}))
|
||||
public final Source source(Path path, OpenOption... options) {
|
||||
Intrinsics.checkNotNullParameter(path, "path");
|
||||
Intrinsics.checkNotNullParameter(options, "options");
|
||||
return Okio.source(path, (OpenOption[]) Arrays.copyOf(options, options.length));
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "socket.source()", imports = {"okio.source"}))
|
||||
public final Source source(Socket socket) {
|
||||
Intrinsics.checkNotNullParameter(socket, "socket");
|
||||
return Okio.source(socket);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "blackholeSink()", imports = {"okio.blackholeSink"}))
|
||||
public final Sink blackhole() {
|
||||
return Okio.blackhole();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package okio;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: -DeprecatedUpgrade.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u0012\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\"\u0011\u0010\u0000\u001a\u00020\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003\"\u0011\u0010\u0004\u001a\u00020\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007¨\u0006\b"}, m238d2 = {"Okio", "Lokio/-DeprecatedOkio;", "getOkio", "()Lokio/-DeprecatedOkio;", "Utf8", "Lokio/-DeprecatedUtf8;", "getUtf8", "()Lokio/-DeprecatedUtf8;", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-DeprecatedUpgrade, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class DeprecatedUpgrade {
|
||||
private static final DeprecatedOkio Okio = DeprecatedOkio.INSTANCE;
|
||||
private static final DeprecatedUtf8 Utf8 = DeprecatedUtf8.INSTANCE;
|
||||
|
||||
public static final DeprecatedOkio getOkio() {
|
||||
return Okio;
|
||||
}
|
||||
|
||||
public static final DeprecatedUtf8 getUtf8() {
|
||||
return Utf8;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package okio;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: -DeprecatedUtf8.kt */
|
||||
@Deprecated(message = "changed in Okio 2.x")
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\bÇ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J \u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\bH\u0007¨\u0006\n"}, m238d2 = {"Lokio/-DeprecatedUtf8;", "", "()V", "size", "", TypedValues.Custom.S_STRING, "", "beginIndex", "", "endIndex", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-DeprecatedUtf8, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class DeprecatedUtf8 {
|
||||
public static final DeprecatedUtf8 INSTANCE = new DeprecatedUtf8();
|
||||
|
||||
private DeprecatedUtf8() {
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.utf8Size()", imports = {"okio.utf8Size"}))
|
||||
public final long size(String string) {
|
||||
Intrinsics.checkNotNullParameter(string, "string");
|
||||
return Utf8.size$default(string, 0, 0, 3, null);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.utf8Size(beginIndex, endIndex)", imports = {"okio.utf8Size"}))
|
||||
public final long size(String string, int beginIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(string, "string");
|
||||
return Utf8.size(string, beginIndex, endIndex);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ForwardingSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\b&\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0001¢\u0006\u0002\u0010\u0003J\b\u0010\u0005\u001a\u00020\u0006H\u0016J\r\u0010\u0002\u001a\u00020\u0001H\u0007¢\u0006\u0002\b\u0007J\b\u0010\b\u001a\u00020\u0006H\u0016J\b\u0010\t\u001a\u00020\nH\u0016J\b\u0010\u000b\u001a\u00020\fH\u0016J\u0018\u0010\r\u001a\u00020\u00062\u0006\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u0011H\u0016R\u0013\u0010\u0002\u001a\u00020\u00018\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0004¨\u0006\u0012"}, m238d2 = {"Lokio/ForwardingSink;", "Lokio/Sink;", "delegate", "(Lokio/Sink;)V", "()Lokio/Sink;", "close", "", "-deprecated_delegate", "flush", "timeout", "Lokio/Timeout;", "toString", "", "write", "source", "Lokio/Buffer;", "byteCount", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public abstract class ForwardingSink implements Sink {
|
||||
private final Sink delegate;
|
||||
|
||||
public ForwardingSink(Sink delegate) {
|
||||
Intrinsics.checkNotNullParameter(delegate, "delegate");
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
public final Sink delegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
public void write(Buffer source, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
this.delegate.write(source, byteCount);
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
public void flush() throws IOException {
|
||||
this.delegate.flush();
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
/* renamed from: timeout */
|
||||
public Timeout getTimeout() {
|
||||
return this.delegate.getTimeout();
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
this.delegate.close();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + '(' + this.delegate + ')';
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "delegate", imports = {}))
|
||||
/* renamed from: -deprecated_delegate, reason: not valid java name and from getter */
|
||||
public final Sink getDelegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ForwardingSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\b&\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0001¢\u0006\u0002\u0010\u0003J\b\u0010\u0005\u001a\u00020\u0006H\u0016J\r\u0010\u0002\u001a\u00020\u0001H\u0007¢\u0006\u0002\b\u0007J\u0018\u0010\b\u001a\u00020\t2\u0006\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\tH\u0016J\b\u0010\r\u001a\u00020\u000eH\u0016J\b\u0010\u000f\u001a\u00020\u0010H\u0016R\u0013\u0010\u0002\u001a\u00020\u00018\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0004¨\u0006\u0011"}, m238d2 = {"Lokio/ForwardingSource;", "Lokio/Source;", "delegate", "(Lokio/Source;)V", "()Lokio/Source;", "close", "", "-deprecated_delegate", "read", "", "sink", "Lokio/Buffer;", "byteCount", "timeout", "Lokio/Timeout;", "toString", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public abstract class ForwardingSource implements Source {
|
||||
private final Source delegate;
|
||||
|
||||
public ForwardingSource(Source delegate) {
|
||||
Intrinsics.checkNotNullParameter(delegate, "delegate");
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
public final Source delegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
public long read(Buffer sink, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return this.delegate.read(sink, byteCount);
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
/* renamed from: timeout */
|
||||
public Timeout getTimeout() {
|
||||
return this.delegate.getTimeout();
|
||||
}
|
||||
|
||||
@Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
this.delegate.close();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getClass().getSimpleName() + '(' + this.delegate + ')';
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "delegate", imports = {}))
|
||||
/* renamed from: -deprecated_delegate, reason: not valid java name and from getter */
|
||||
public final Source getDelegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: ForwardingTimeout.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0016\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0001¢\u0006\u0002\u0010\u0003J\b\u0010\u0006\u001a\u00020\u0001H\u0016J\b\u0010\u0007\u001a\u00020\u0001H\u0016J\b\u0010\b\u001a\u00020\tH\u0016J\u0010\u0010\b\u001a\u00020\u00012\u0006\u0010\b\u001a\u00020\tH\u0016J\b\u0010\n\u001a\u00020\u000bH\u0016J\u000e\u0010\u0005\u001a\u00020\u00002\u0006\u0010\u0002\u001a\u00020\u0001J\b\u0010\f\u001a\u00020\rH\u0016J\u0018\u0010\u000e\u001a\u00020\u00012\u0006\u0010\u000e\u001a\u00020\t2\u0006\u0010\u000f\u001a\u00020\u0010H\u0016J\b\u0010\u0011\u001a\u00020\tH\u0016R\u001c\u0010\u0002\u001a\u00020\u00018\u0007X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0002\u0010\u0004\"\u0004\b\u0005\u0010\u0003¨\u0006\u0012"}, m238d2 = {"Lokio/ForwardingTimeout;", "Lokio/Timeout;", "delegate", "(Lokio/Timeout;)V", "()Lokio/Timeout;", "setDelegate", "clearDeadline", "clearTimeout", "deadlineNanoTime", "", "hasDeadline", "", "throwIfReached", "", "timeout", "unit", "Ljava/util/concurrent/TimeUnit;", "timeoutNanos", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public class ForwardingTimeout extends Timeout {
|
||||
private Timeout delegate;
|
||||
|
||||
public ForwardingTimeout(Timeout delegate) {
|
||||
Intrinsics.checkNotNullParameter(delegate, "delegate");
|
||||
this.delegate = delegate;
|
||||
}
|
||||
|
||||
/* renamed from: delegate, reason: from getter */
|
||||
public final Timeout getDelegate() {
|
||||
return this.delegate;
|
||||
}
|
||||
|
||||
/* renamed from: setDelegate, reason: collision with other method in class */
|
||||
public final /* synthetic */ void m1757setDelegate(Timeout timeout) {
|
||||
Intrinsics.checkNotNullParameter(timeout, "<set-?>");
|
||||
this.delegate = timeout;
|
||||
}
|
||||
|
||||
public final ForwardingTimeout setDelegate(Timeout delegate) {
|
||||
Intrinsics.checkNotNullParameter(delegate, "delegate");
|
||||
this.delegate = delegate;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public Timeout timeout(long timeout, TimeUnit unit) {
|
||||
Intrinsics.checkNotNullParameter(unit, "unit");
|
||||
return this.delegate.timeout(timeout, unit);
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
/* renamed from: timeoutNanos */
|
||||
public long getTimeoutNanos() {
|
||||
return this.delegate.getTimeoutNanos();
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
/* renamed from: hasDeadline */
|
||||
public boolean getHasDeadline() {
|
||||
return this.delegate.getHasDeadline();
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public long deadlineNanoTime() {
|
||||
return this.delegate.deadlineNanoTime();
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public Timeout deadlineNanoTime(long deadlineNanoTime) {
|
||||
return this.delegate.deadlineNanoTime(deadlineNanoTime);
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public Timeout clearTimeout() {
|
||||
return this.delegate.clearTimeout();
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public Timeout clearDeadline() {
|
||||
return this.delegate.clearDeadline();
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public void throwIfReached() throws IOException {
|
||||
this.delegate.throwIfReached();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.zip.CRC32;
|
||||
import java.util.zip.Deflater;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: GzipSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0001¢\u0006\u0002\u0010\u0003J\b\u0010\u000e\u001a\u00020\u000fH\u0016J\r\u0010\b\u001a\u00020\tH\u0007¢\u0006\u0002\b\u0010J\b\u0010\u0011\u001a\u00020\u000fH\u0016J\b\u0010\u0012\u001a\u00020\u0013H\u0016J\u0018\u0010\u0014\u001a\u00020\u000f2\u0006\u0010\u0015\u001a\u00020\u00162\u0006\u0010\u0017\u001a\u00020\u0018H\u0002J\u0018\u0010\u0019\u001a\u00020\u000f2\u0006\u0010\u001a\u001a\u00020\u00162\u0006\u0010\u0017\u001a\u00020\u0018H\u0016J\b\u0010\u001b\u001a\u00020\u000fH\u0002R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u0013\u0010\b\u001a\u00020\t8G¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\nR\u000e\u0010\u000b\u001a\u00020\fX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\rX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001c"}, m238d2 = {"Lokio/GzipSink;", "Lokio/Sink;", "sink", "(Lokio/Sink;)V", "closed", "", "crc", "Ljava/util/zip/CRC32;", "deflater", "Ljava/util/zip/Deflater;", "()Ljava/util/zip/Deflater;", "deflaterSink", "Lokio/DeflaterSink;", "Lokio/RealBufferedSink;", "close", "", "-deprecated_deflater", "flush", "timeout", "Lokio/Timeout;", "updateCrc", "buffer", "Lokio/Buffer;", "byteCount", "", "write", "source", "writeFooter", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class GzipSink implements Sink {
|
||||
private boolean closed;
|
||||
private final CRC32 crc;
|
||||
private final Deflater deflater;
|
||||
private final DeflaterSink deflaterSink;
|
||||
private final buffer sink;
|
||||
|
||||
public GzipSink(Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
buffer bufferVar = new buffer(sink);
|
||||
this.sink = bufferVar;
|
||||
Deflater deflater = new Deflater(-1, true);
|
||||
this.deflater = deflater;
|
||||
this.deflaterSink = new DeflaterSink((BufferedSink) bufferVar, deflater);
|
||||
this.crc = new CRC32();
|
||||
buffer this_$iv = this.sink;
|
||||
Buffer $this$apply = this_$iv.bufferField;
|
||||
$this$apply.writeShort(8075);
|
||||
$this$apply.writeByte(8);
|
||||
$this$apply.writeByte(0);
|
||||
$this$apply.writeInt(0);
|
||||
$this$apply.writeByte(0);
|
||||
$this$apply.writeByte(0);
|
||||
}
|
||||
|
||||
public final Deflater deflater() {
|
||||
return this.deflater;
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
public void write(Buffer source, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
if (!(byteCount >= 0)) {
|
||||
throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString());
|
||||
}
|
||||
if (byteCount == 0) {
|
||||
return;
|
||||
}
|
||||
updateCrc(source, byteCount);
|
||||
this.deflaterSink.write(source, byteCount);
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
public void flush() throws IOException {
|
||||
this.deflaterSink.flush();
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
public Timeout timeout() {
|
||||
return this.sink.timeout();
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
Throwable thrown = (Throwable) null;
|
||||
try {
|
||||
this.deflaterSink.finishDeflate$okio();
|
||||
writeFooter();
|
||||
} catch (Throwable e) {
|
||||
thrown = e;
|
||||
}
|
||||
try {
|
||||
this.deflater.end();
|
||||
} catch (Throwable e2) {
|
||||
if (thrown == null) {
|
||||
thrown = e2;
|
||||
}
|
||||
}
|
||||
try {
|
||||
this.sink.close();
|
||||
} catch (Throwable e3) {
|
||||
if (thrown == null) {
|
||||
thrown = e3;
|
||||
}
|
||||
}
|
||||
this.closed = true;
|
||||
if (thrown != null) {
|
||||
throw thrown;
|
||||
}
|
||||
}
|
||||
|
||||
private final void writeFooter() {
|
||||
this.sink.writeIntLe((int) this.crc.getValue());
|
||||
this.sink.writeIntLe((int) this.deflater.getBytesRead());
|
||||
}
|
||||
|
||||
private final void updateCrc(Buffer buffer, long byteCount) {
|
||||
Segment head = buffer.head;
|
||||
Intrinsics.checkNotNull(head);
|
||||
long remaining = byteCount;
|
||||
while (remaining > 0) {
|
||||
int b$iv = (int) Math.min(remaining, head.limit - head.pos);
|
||||
this.crc.update(head.data, head.pos, b$iv);
|
||||
remaining -= b$iv;
|
||||
Segment segment = head.next;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
head = segment;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "deflater", imports = {}))
|
||||
/* renamed from: -deprecated_deflater, reason: not valid java name and from getter */
|
||||
public final Deflater getDeflater() {
|
||||
return this.deflater;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package okio;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: GzipSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u001a\r\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u0086\b¨\u0006\u0003"}, m238d2 = {"gzip", "Lokio/GzipSink;", "Lokio/Sink;", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-GzipSinkExtensions, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class GzipSinkExtensions {
|
||||
public static final GzipSink gzip(Sink gzip) {
|
||||
Intrinsics.checkNotNullParameter(gzip, "$this$gzip");
|
||||
return new GzipSink(gzip);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
package okio;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.zip.CRC32;
|
||||
import java.util.zip.Inflater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: GzipSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000R\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0001¢\u0006\u0002\u0010\u0003J \u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0012H\u0002J\b\u0010\u0014\u001a\u00020\u000eH\u0016J\b\u0010\u0015\u001a\u00020\u000eH\u0002J\b\u0010\u0016\u001a\u00020\u000eH\u0002J\u0018\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\u001a2\u0006\u0010\u001b\u001a\u00020\u0018H\u0016J\b\u0010\u001c\u001a\u00020\u001dH\u0016J \u0010\u001e\u001a\u00020\u000e2\u0006\u0010\u001f\u001a\u00020\u001a2\u0006\u0010 \u001a\u00020\u00182\u0006\u0010\u001b\u001a\u00020\u0018H\u0002R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\fX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006!"}, m238d2 = {"Lokio/GzipSource;", "Lokio/Source;", "source", "(Lokio/Source;)V", "crc", "Ljava/util/zip/CRC32;", "inflater", "Ljava/util/zip/Inflater;", "inflaterSource", "Lokio/InflaterSource;", "section", "", "Lokio/RealBufferedSource;", "checkEqual", "", "name", "", "expected", "", "actual", "close", "consumeHeader", "consumeTrailer", "read", "", "sink", "Lokio/Buffer;", "byteCount", "timeout", "Lokio/Timeout;", "updateCrc", "buffer", TypedValues.Cycle.S_WAVE_OFFSET, "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class GzipSource implements Source {
|
||||
private final CRC32 crc;
|
||||
private final Inflater inflater;
|
||||
private final InflaterSource inflaterSource;
|
||||
private byte section;
|
||||
private final buffer source;
|
||||
|
||||
public GzipSource(Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
buffer bufferVar = new buffer(source);
|
||||
this.source = bufferVar;
|
||||
Inflater inflater = new Inflater(true);
|
||||
this.inflater = inflater;
|
||||
this.inflaterSource = new InflaterSource((BufferedSource) bufferVar, inflater);
|
||||
this.crc = new CRC32();
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
public long read(Buffer sink, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
if (!(byteCount >= 0)) {
|
||||
throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString());
|
||||
}
|
||||
if (byteCount == 0) {
|
||||
return 0L;
|
||||
}
|
||||
if (this.section == 0) {
|
||||
consumeHeader();
|
||||
this.section = (byte) 1;
|
||||
}
|
||||
if (this.section == 1) {
|
||||
long offset = sink.size();
|
||||
long result = this.inflaterSource.read(sink, byteCount);
|
||||
if (result != -1) {
|
||||
updateCrc(sink, offset, result);
|
||||
return result;
|
||||
}
|
||||
this.section = (byte) 2;
|
||||
}
|
||||
if (this.section == 2) {
|
||||
consumeTrailer();
|
||||
this.section = (byte) 3;
|
||||
if (!this.source.exhausted()) {
|
||||
throw new IOException("gzip finished without exhausting source");
|
||||
}
|
||||
}
|
||||
return -1L;
|
||||
}
|
||||
|
||||
private final void consumeHeader() throws IOException {
|
||||
this.source.require(10L);
|
||||
buffer this_$iv = this.source;
|
||||
int flags = this_$iv.bufferField.getByte(3L);
|
||||
int bit$iv = ((flags >> 1) & 1) == 1 ? 1 : 0;
|
||||
int i = bit$iv;
|
||||
if (i != 0) {
|
||||
buffer this_$iv2 = this.source;
|
||||
updateCrc(this_$iv2.bufferField, 0L, 10L);
|
||||
}
|
||||
short id1id2 = this.source.readShort();
|
||||
checkEqual("ID1ID2", 8075, id1id2);
|
||||
this.source.skip(8L);
|
||||
int bit$iv2 = ((flags >> 2) & 1) == 1 ? 1 : 0;
|
||||
if (bit$iv2 != 0) {
|
||||
this.source.require(2L);
|
||||
if (i != 0) {
|
||||
buffer this_$iv3 = this.source;
|
||||
updateCrc(this_$iv3.bufferField, 0L, 2L);
|
||||
}
|
||||
buffer this_$iv4 = this.source;
|
||||
long xlen = this_$iv4.bufferField.readShortLe();
|
||||
this.source.require(xlen);
|
||||
if (i != 0) {
|
||||
buffer this_$iv5 = this.source;
|
||||
updateCrc(this_$iv5.bufferField, 0L, xlen);
|
||||
}
|
||||
this.source.skip(xlen);
|
||||
}
|
||||
int bit$iv3 = ((flags >> 3) & 1) == 1 ? 1 : 0;
|
||||
if (bit$iv3 != 0) {
|
||||
long index = this.source.indexOf((byte) 0);
|
||||
if (index == -1) {
|
||||
throw new EOFException();
|
||||
}
|
||||
if (i != 0) {
|
||||
buffer this_$iv6 = this.source;
|
||||
updateCrc(this_$iv6.bufferField, 0L, index + 1);
|
||||
}
|
||||
this.source.skip(index + 1);
|
||||
}
|
||||
if (((flags >> 4) & 1) == 1) {
|
||||
long index2 = this.source.indexOf((byte) 0);
|
||||
if (index2 == -1) {
|
||||
throw new EOFException();
|
||||
}
|
||||
if (i != 0) {
|
||||
buffer this_$iv7 = this.source;
|
||||
updateCrc(this_$iv7.bufferField, 0L, index2 + 1);
|
||||
}
|
||||
this.source.skip(1 + index2);
|
||||
}
|
||||
if (i != 0) {
|
||||
checkEqual("FHCRC", this.source.readShortLe(), (short) this.crc.getValue());
|
||||
this.crc.reset();
|
||||
}
|
||||
}
|
||||
|
||||
private final void consumeTrailer() throws IOException {
|
||||
checkEqual("CRC", this.source.readIntLe(), (int) this.crc.getValue());
|
||||
checkEqual("ISIZE", this.source.readIntLe(), (int) this.inflater.getBytesWritten());
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
public Timeout timeout() {
|
||||
return this.source.timeout();
|
||||
}
|
||||
|
||||
@Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
this.inflaterSource.close();
|
||||
}
|
||||
|
||||
private final void updateCrc(Buffer buffer, long offset, long byteCount) {
|
||||
long offset2 = offset;
|
||||
long byteCount2 = byteCount;
|
||||
Segment s = buffer.head;
|
||||
Intrinsics.checkNotNull(s);
|
||||
while (offset2 >= s.limit - s.pos) {
|
||||
offset2 -= s.limit - s.pos;
|
||||
Segment segment = s.next;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
s = segment;
|
||||
}
|
||||
while (byteCount2 > 0) {
|
||||
int pos = (int) (s.pos + offset2);
|
||||
int a$iv = (int) Math.min(s.limit - pos, byteCount2);
|
||||
this.crc.update(s.data, pos, a$iv);
|
||||
byteCount2 -= a$iv;
|
||||
offset2 = 0;
|
||||
Segment segment2 = s.next;
|
||||
Intrinsics.checkNotNull(segment2);
|
||||
s = segment2;
|
||||
}
|
||||
}
|
||||
|
||||
private final void checkEqual(String name, int expected, int actual) {
|
||||
if (actual != expected) {
|
||||
String format = String.format("%s: actual 0x%08x != expected 0x%08x", Arrays.copyOf(new Object[]{name, Integer.valueOf(actual), Integer.valueOf(expected)}, 3));
|
||||
Intrinsics.checkNotNullExpressionValue(format, "java.lang.String.format(this, *args)");
|
||||
throw new IOException(format);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package okio;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: GzipSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000$\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u0005\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u001a\u0015\u0010\n\u001a\u00020\u000b*\u00020\u00012\u0006\u0010\f\u001a\u00020\u0001H\u0082\b\u001a\r\u0010\r\u001a\u00020\u000e*\u00020\u000fH\u0086\b\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0004\u001a\u00020\u0001X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0005\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0007\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\b\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000\"\u000e\u0010\t\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000¨\u0006\u0010"}, m238d2 = {"FCOMMENT", "", "FEXTRA", "FHCRC", "FNAME", "SECTION_BODY", "", "SECTION_DONE", "SECTION_HEADER", "SECTION_TRAILER", "getBit", "", "bit", "gzip", "Lokio/GzipSource;", "Lokio/Source;", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-GzipSourceExtensions, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class GzipSourceExtensions {
|
||||
private static final int FCOMMENT = 4;
|
||||
private static final int FEXTRA = 2;
|
||||
private static final int FHCRC = 1;
|
||||
private static final int FNAME = 3;
|
||||
private static final byte SECTION_BODY = 1;
|
||||
private static final byte SECTION_DONE = 3;
|
||||
private static final byte SECTION_HEADER = 0;
|
||||
private static final byte SECTION_TRAILER = 2;
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final boolean getBit(int $this$getBit, int bit) {
|
||||
return (($this$getBit >> bit) & 1) == 1;
|
||||
}
|
||||
|
||||
public static final GzipSource gzip(Source gzip) {
|
||||
Intrinsics.checkNotNullParameter(gzip, "$this$gzip");
|
||||
return new GzipSource(gzip);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.MessageDigest;
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: HashingSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\u0018\u0000 \u00172\u00020\u0001:\u0001\u0017B\u0017\b\u0010\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006B\u001f\b\u0010\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0007\u001a\u00020\b\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\tJ\r\u0010\n\u001a\u00020\bH\u0007¢\u0006\u0002\b\u0010J\u0018\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0016H\u0016R\u0011\u0010\n\u001a\u00020\b8G¢\u0006\u0006\u001a\u0004\b\n\u0010\u000bR\u0010\u0010\f\u001a\u0004\u0018\u00010\rX\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u000e\u001a\u0004\u0018\u00010\u000fX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0018"}, m238d2 = {"Lokio/HashingSink;", "Lokio/ForwardingSink;", "sink", "Lokio/Sink;", "algorithm", "", "(Lokio/Sink;Ljava/lang/String;)V", "key", "Lokio/ByteString;", "(Lokio/Sink;Lokio/ByteString;Ljava/lang/String;)V", "hash", "()Lokio/ByteString;", "mac", "Ljavax/crypto/Mac;", "messageDigest", "Ljava/security/MessageDigest;", "-deprecated_hash", "write", "", "source", "Lokio/Buffer;", "byteCount", "", "Companion", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class HashingSink extends ForwardingSink {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private final Mac mac;
|
||||
private final MessageDigest messageDigest;
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSink hmacSha1(Sink sink, ByteString byteString) {
|
||||
return INSTANCE.hmacSha1(sink, byteString);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSink hmacSha256(Sink sink, ByteString byteString) {
|
||||
return INSTANCE.hmacSha256(sink, byteString);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSink hmacSha512(Sink sink, ByteString byteString) {
|
||||
return INSTANCE.hmacSha512(sink, byteString);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSink md5(Sink sink) {
|
||||
return INSTANCE.md5(sink);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSink sha1(Sink sink) {
|
||||
return INSTANCE.sha1(sink);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSink sha256(Sink sink) {
|
||||
return INSTANCE.sha256(sink);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSink sha512(Sink sink) {
|
||||
return INSTANCE.sha512(sink);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public HashingSink(Sink sink, String algorithm) {
|
||||
super(sink);
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Intrinsics.checkNotNullParameter(algorithm, "algorithm");
|
||||
this.messageDigest = MessageDigest.getInstance(algorithm);
|
||||
this.mac = null;
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public HashingSink(Sink sink, ByteString key, String algorithm) {
|
||||
super(sink);
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Intrinsics.checkNotNullParameter(algorithm, "algorithm");
|
||||
try {
|
||||
Mac $this$apply = Mac.getInstance(algorithm);
|
||||
$this$apply.init(new SecretKeySpec(key.toByteArray(), algorithm));
|
||||
Unit unit = Unit.INSTANCE;
|
||||
this.mac = $this$apply;
|
||||
this.messageDigest = null;
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.ForwardingSink, okio.Sink
|
||||
public void write(Buffer source, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Util.checkOffsetAndCount(source.size(), 0L, byteCount);
|
||||
long hashedCount = 0;
|
||||
Segment s = source.head;
|
||||
Intrinsics.checkNotNull(s);
|
||||
while (hashedCount < byteCount) {
|
||||
long a$iv = byteCount - hashedCount;
|
||||
int b$iv = s.limit - s.pos;
|
||||
int toHash = (int) Math.min(a$iv, b$iv);
|
||||
MessageDigest messageDigest = this.messageDigest;
|
||||
if (messageDigest != null) {
|
||||
messageDigest.update(s.data, s.pos, toHash);
|
||||
} else {
|
||||
Mac mac = this.mac;
|
||||
Intrinsics.checkNotNull(mac);
|
||||
mac.update(s.data, s.pos, toHash);
|
||||
}
|
||||
hashedCount += toHash;
|
||||
Segment segment = s.next;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
s = segment;
|
||||
}
|
||||
super.write(source, byteCount);
|
||||
}
|
||||
|
||||
public final ByteString hash() {
|
||||
byte[] result;
|
||||
MessageDigest messageDigest = this.messageDigest;
|
||||
if (messageDigest != null) {
|
||||
result = messageDigest.digest();
|
||||
} else {
|
||||
Mac mac = this.mac;
|
||||
Intrinsics.checkNotNull(mac);
|
||||
result = mac.doFinal();
|
||||
}
|
||||
Intrinsics.checkNotNullExpressionValue(result, "result");
|
||||
return new ByteString(result);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "hash", imports = {}))
|
||||
/* renamed from: -deprecated_hash, reason: not valid java name */
|
||||
public final ByteString m1759deprecated_hash() {
|
||||
return hash();
|
||||
}
|
||||
|
||||
/* compiled from: HashingSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007J\u0018\u0010\t\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007J\u0018\u0010\n\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007J\u0010\u0010\u000b\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\f\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\r\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\u000e\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007¨\u0006\u000f"}, m238d2 = {"Lokio/HashingSink$Companion;", "", "()V", "hmacSha1", "Lokio/HashingSink;", "sink", "Lokio/Sink;", "key", "Lokio/ByteString;", "hmacSha256", "hmacSha512", "md5", "sha1", "sha256", "sha512", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
public static final class Companion {
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
|
||||
this();
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSink md5(Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return new HashingSink(sink, "MD5");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSink sha1(Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return new HashingSink(sink, "SHA-1");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSink sha256(Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return new HashingSink(sink, "SHA-256");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSink sha512(Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return new HashingSink(sink, "SHA-512");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSink hmacSha1(Sink sink, ByteString key) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return new HashingSink(sink, key, "HmacSHA1");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSink hmacSha256(Sink sink, ByteString key) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return new HashingSink(sink, key, "HmacSHA256");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSink hmacSha512(Sink sink, ByteString key) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return new HashingSink(sink, key, "HmacSHA512");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.MessageDigest;
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: HashingSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000<\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u0000 \u00162\u00020\u0001:\u0001\u0016B\u0017\b\u0010\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006B\u001f\b\u0010\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0007\u001a\u00020\b\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\tJ\r\u0010\n\u001a\u00020\bH\u0007¢\u0006\u0002\b\u0010J\u0018\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0012H\u0016R\u0011\u0010\n\u001a\u00020\b8G¢\u0006\u0006\u001a\u0004\b\n\u0010\u000bR\u0010\u0010\f\u001a\u0004\u0018\u00010\rX\u0082\u0004¢\u0006\u0002\n\u0000R\u0010\u0010\u000e\u001a\u0004\u0018\u00010\u000fX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0017"}, m238d2 = {"Lokio/HashingSource;", "Lokio/ForwardingSource;", "source", "Lokio/Source;", "algorithm", "", "(Lokio/Source;Ljava/lang/String;)V", "key", "Lokio/ByteString;", "(Lokio/Source;Lokio/ByteString;Ljava/lang/String;)V", "hash", "()Lokio/ByteString;", "mac", "Ljavax/crypto/Mac;", "messageDigest", "Ljava/security/MessageDigest;", "-deprecated_hash", "read", "", "sink", "Lokio/Buffer;", "byteCount", "Companion", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class HashingSource extends ForwardingSource {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private final Mac mac;
|
||||
private final MessageDigest messageDigest;
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSource hmacSha1(Source source, ByteString byteString) {
|
||||
return INSTANCE.hmacSha1(source, byteString);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSource hmacSha256(Source source, ByteString byteString) {
|
||||
return INSTANCE.hmacSha256(source, byteString);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSource hmacSha512(Source source, ByteString byteString) {
|
||||
return INSTANCE.hmacSha512(source, byteString);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSource md5(Source source) {
|
||||
return INSTANCE.md5(source);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSource sha1(Source source) {
|
||||
return INSTANCE.sha1(source);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSource sha256(Source source) {
|
||||
return INSTANCE.sha256(source);
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final HashingSource sha512(Source source) {
|
||||
return INSTANCE.sha512(source);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public HashingSource(Source source, String algorithm) {
|
||||
super(source);
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(algorithm, "algorithm");
|
||||
this.messageDigest = MessageDigest.getInstance(algorithm);
|
||||
this.mac = null;
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public HashingSource(Source source, ByteString key, String algorithm) {
|
||||
super(source);
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
Intrinsics.checkNotNullParameter(algorithm, "algorithm");
|
||||
try {
|
||||
Mac $this$apply = Mac.getInstance(algorithm);
|
||||
$this$apply.init(new SecretKeySpec(key.toByteArray(), algorithm));
|
||||
Unit unit = Unit.INSTANCE;
|
||||
this.mac = $this$apply;
|
||||
this.messageDigest = null;
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.ForwardingSource, okio.Source
|
||||
public long read(Buffer sink, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
long result = super.read(sink, byteCount);
|
||||
if (result != -1) {
|
||||
long start = sink.size() - result;
|
||||
long offset = sink.size();
|
||||
Segment s = sink.head;
|
||||
Intrinsics.checkNotNull(s);
|
||||
while (offset > start) {
|
||||
Segment segment = s.prev;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
s = segment;
|
||||
offset -= s.limit - s.pos;
|
||||
}
|
||||
while (offset < sink.size()) {
|
||||
int pos = (int) ((s.pos + start) - offset);
|
||||
MessageDigest messageDigest = this.messageDigest;
|
||||
if (messageDigest != null) {
|
||||
messageDigest.update(s.data, pos, s.limit - pos);
|
||||
} else {
|
||||
Mac mac = this.mac;
|
||||
Intrinsics.checkNotNull(mac);
|
||||
mac.update(s.data, pos, s.limit - pos);
|
||||
}
|
||||
offset += s.limit - s.pos;
|
||||
start = offset;
|
||||
Segment segment2 = s.next;
|
||||
Intrinsics.checkNotNull(segment2);
|
||||
s = segment2;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public final ByteString hash() {
|
||||
byte[] result;
|
||||
MessageDigest messageDigest = this.messageDigest;
|
||||
if (messageDigest != null) {
|
||||
result = messageDigest.digest();
|
||||
} else {
|
||||
Mac mac = this.mac;
|
||||
Intrinsics.checkNotNull(mac);
|
||||
result = mac.doFinal();
|
||||
}
|
||||
Intrinsics.checkNotNullExpressionValue(result, "result");
|
||||
return new ByteString(result);
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "hash", imports = {}))
|
||||
/* renamed from: -deprecated_hash, reason: not valid java name */
|
||||
public final ByteString m1760deprecated_hash() {
|
||||
return hash();
|
||||
}
|
||||
|
||||
/* compiled from: HashingSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007J\u0018\u0010\t\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007J\u0018\u0010\n\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0007J\u0010\u0010\u000b\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\f\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\r\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007J\u0010\u0010\u000e\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007¨\u0006\u000f"}, m238d2 = {"Lokio/HashingSource$Companion;", "", "()V", "hmacSha1", "Lokio/HashingSource;", "source", "Lokio/Source;", "key", "Lokio/ByteString;", "hmacSha256", "hmacSha512", "md5", "sha1", "sha256", "sha512", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
public static final class Companion {
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
|
||||
this();
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSource md5(Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new HashingSource(source, "MD5");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSource sha1(Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new HashingSource(source, "SHA-1");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSource sha256(Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new HashingSource(source, "SHA-256");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSource sha512(Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new HashingSource(source, "SHA-512");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSource hmacSha1(Source source, ByteString key) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return new HashingSource(source, key, "HmacSHA1");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSource hmacSha256(Source source, ByteString key) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return new HashingSource(source, key, "HmacSHA256");
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public final HashingSource hmacSha512(Source source, ByteString key) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
return new HashingSource(source, key, "HmacSHA512");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package okio;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.IOException;
|
||||
import java.util.zip.DataFormatException;
|
||||
import java.util.zip.Inflater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: InflaterSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\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\b\u0005\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0017\b\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0001\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005B\u0017\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0006\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0007J\b\u0010\f\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\b\u0010\u0015\u001a\u00020\rH\u0002J\b\u0010\u0016\u001a\u00020\u0017H\u0016R\u000e\u0010\b\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0018"}, m238d2 = {"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"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class InflaterSource implements Source {
|
||||
private int bufferBytesHeldByInflater;
|
||||
private boolean closed;
|
||||
private final Inflater inflater;
|
||||
private final BufferedSource source;
|
||||
|
||||
public InflaterSource(BufferedSource source, Inflater inflater) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(inflater, "inflater");
|
||||
this.source = source;
|
||||
this.inflater = inflater;
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public InflaterSource(Source source, Inflater inflater) {
|
||||
this(Okio.buffer(source), inflater);
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(inflater, "inflater");
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
public long read(Buffer sink, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
do {
|
||||
long bytesInflated = readOrInflate(sink, byteCount);
|
||||
if (bytesInflated > 0) {
|
||||
return bytesInflated;
|
||||
}
|
||||
if (this.inflater.finished() || this.inflater.needsDictionary()) {
|
||||
return -1L;
|
||||
}
|
||||
} while (!this.source.exhausted());
|
||||
throw new EOFException("source exhausted prematurely");
|
||||
}
|
||||
|
||||
public final long readOrInflate(Buffer sink, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
if (!(byteCount >= 0)) {
|
||||
throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString());
|
||||
}
|
||||
if (!(!this.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (byteCount == 0) {
|
||||
return 0L;
|
||||
}
|
||||
try {
|
||||
Segment tail = sink.writableSegment$okio(1);
|
||||
int b$iv = 8192 - tail.limit;
|
||||
int b$iv2 = (int) Math.min(byteCount, b$iv);
|
||||
refill();
|
||||
int bytesInflated = this.inflater.inflate(tail.data, tail.limit, b$iv2);
|
||||
releaseBytesAfterInflate();
|
||||
if (bytesInflated > 0) {
|
||||
tail.limit += bytesInflated;
|
||||
sink.setSize$okio(sink.size() + bytesInflated);
|
||||
return bytesInflated;
|
||||
}
|
||||
if (tail.pos == tail.limit) {
|
||||
sink.head = tail.pop();
|
||||
SegmentPool.recycle(tail);
|
||||
}
|
||||
return 0L;
|
||||
} catch (DataFormatException e) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean refill() throws IOException {
|
||||
if (!this.inflater.needsInput()) {
|
||||
return false;
|
||||
}
|
||||
if (this.source.exhausted()) {
|
||||
return true;
|
||||
}
|
||||
Segment head = this.source.getBuffer().head;
|
||||
Intrinsics.checkNotNull(head);
|
||||
this.bufferBytesHeldByInflater = head.limit - head.pos;
|
||||
this.inflater.setInput(head.data, head.pos, this.bufferBytesHeldByInflater);
|
||||
return false;
|
||||
}
|
||||
|
||||
private final void releaseBytesAfterInflate() {
|
||||
int i = this.bufferBytesHeldByInflater;
|
||||
if (i == 0) {
|
||||
return;
|
||||
}
|
||||
int toRelease = i - this.inflater.getRemaining();
|
||||
this.bufferBytesHeldByInflater -= toRelease;
|
||||
this.source.skip(toRelease);
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
public Timeout timeout() {
|
||||
return this.source.timeout();
|
||||
}
|
||||
|
||||
@Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() throws IOException {
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
this.inflater.end();
|
||||
this.closed = true;
|
||||
this.source.close();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package okio;
|
||||
|
||||
import java.util.zip.Inflater;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: InflaterSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u0012\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0017\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\b\u0002\u0010\u0003\u001a\u00020\u0004H\u0086\b¨\u0006\u0005"}, m238d2 = {"inflate", "Lokio/InflaterSource;", "Lokio/Source;", "inflater", "Ljava/util/zip/Inflater;", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-InflaterSourceExtensions, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class InflaterSourceExtensions {
|
||||
public static /* synthetic */ InflaterSource inflate$default(Source inflate, Inflater inflater, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
inflater = new Inflater();
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(inflate, "$this$inflate");
|
||||
Intrinsics.checkNotNullParameter(inflater, "inflater");
|
||||
return new InflaterSource(inflate, inflater);
|
||||
}
|
||||
|
||||
public static final InflaterSource inflate(Source inflate, Inflater inflater) {
|
||||
Intrinsics.checkNotNullParameter(inflate, "$this$inflate");
|
||||
Intrinsics.checkNotNullParameter(inflater, "inflater");
|
||||
return new InflaterSource(inflate, inflater);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package okio;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.file.OpenOption;
|
||||
import java.nio.file.Path;
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"okio/Okio__JvmOkioKt", "okio/Okio__OkioKt"}, m239k = 4, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Okio {
|
||||
public static final Sink appendingSink(File $this$appendingSink) throws FileNotFoundException {
|
||||
return Okio__JvmOkioKt.appendingSink($this$appendingSink);
|
||||
}
|
||||
|
||||
public static final Sink blackhole() {
|
||||
return Okio__OkioKt.blackhole();
|
||||
}
|
||||
|
||||
public static final BufferedSink buffer(Sink $this$buffer) {
|
||||
return Okio__OkioKt.buffer($this$buffer);
|
||||
}
|
||||
|
||||
public static final BufferedSource buffer(Source $this$buffer) {
|
||||
return Okio__OkioKt.buffer($this$buffer);
|
||||
}
|
||||
|
||||
public static final boolean isAndroidGetsocknameError(AssertionError $this$isAndroidGetsocknameError) {
|
||||
return Okio__JvmOkioKt.isAndroidGetsocknameError($this$isAndroidGetsocknameError);
|
||||
}
|
||||
|
||||
public static final Sink sink(File file) throws FileNotFoundException {
|
||||
return Okio__JvmOkioKt.sink$default(file, false, 1, null);
|
||||
}
|
||||
|
||||
public static final Sink sink(File $this$sink, boolean append) throws FileNotFoundException {
|
||||
return Okio__JvmOkioKt.sink($this$sink, append);
|
||||
}
|
||||
|
||||
public static final Sink sink(OutputStream $this$sink) {
|
||||
return Okio__JvmOkioKt.sink($this$sink);
|
||||
}
|
||||
|
||||
public static final Sink sink(Socket $this$sink) throws IOException {
|
||||
return Okio__JvmOkioKt.sink($this$sink);
|
||||
}
|
||||
|
||||
public static final Sink sink(Path $this$sink, OpenOption... options) throws IOException {
|
||||
return Okio__JvmOkioKt.sink($this$sink, options);
|
||||
}
|
||||
|
||||
public static final Source source(File $this$source) throws FileNotFoundException {
|
||||
return Okio__JvmOkioKt.source($this$source);
|
||||
}
|
||||
|
||||
public static final Source source(InputStream $this$source) {
|
||||
return Okio__JvmOkioKt.source($this$source);
|
||||
}
|
||||
|
||||
public static final Source source(Socket $this$source) throws IOException {
|
||||
return Okio__JvmOkioKt.source($this$source);
|
||||
}
|
||||
|
||||
public static final Source source(Path $this$source, OpenOption... options) throws IOException {
|
||||
return Okio__JvmOkioKt.source($this$source, options);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package okio;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.OpenOption;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.logging.Logger;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.StringsKt;
|
||||
|
||||
/* compiled from: JvmOkio.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000L\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\n\u0010\n\u001a\u00020\u000b*\u00020\f\u001a\u0016\u0010\r\u001a\u00020\u000b*\u00020\f2\b\b\u0002\u0010\u000e\u001a\u00020\u0006H\u0007\u001a\n\u0010\r\u001a\u00020\u000b*\u00020\u000f\u001a\n\u0010\r\u001a\u00020\u000b*\u00020\u0010\u001a%\u0010\r\u001a\u00020\u000b*\u00020\u00112\u0012\u0010\u0012\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00140\u0013\"\u00020\u0014H\u0007¢\u0006\u0002\u0010\u0015\u001a\n\u0010\u0016\u001a\u00020\u0017*\u00020\f\u001a\n\u0010\u0016\u001a\u00020\u0017*\u00020\u0018\u001a\n\u0010\u0016\u001a\u00020\u0017*\u00020\u0010\u001a%\u0010\u0016\u001a\u00020\u0017*\u00020\u00112\u0012\u0010\u0012\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00140\u0013\"\u00020\u0014H\u0007¢\u0006\u0002\u0010\u0019\"\u001c\u0010\u0000\u001a\n \u0002*\u0004\u0018\u00010\u00010\u0001X\u0082\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0003\u0010\u0004\"\u001c\u0010\u0005\u001a\u00020\u0006*\u00060\u0007j\u0002`\b8@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\t¨\u0006\u001a"}, m238d2 = {"logger", "Ljava/util/logging/Logger;", "kotlin.jvm.PlatformType", "getLogger$Okio__JvmOkioKt", "()Ljava/util/logging/Logger;", "isAndroidGetsocknameError", "", "Ljava/lang/AssertionError;", "Lkotlin/AssertionError;", "(Ljava/lang/AssertionError;)Z", "appendingSink", "Lokio/Sink;", "Ljava/io/File;", "sink", "append", "Ljava/io/OutputStream;", "Ljava/net/Socket;", "Ljava/nio/file/Path;", "options", "", "Ljava/nio/file/OpenOption;", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Lokio/Sink;", "source", "Lokio/Source;", "Ljava/io/InputStream;", "(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Lokio/Source;", "okio"}, m239k = 5, m240mv = {1, 4, 0}, m243xs = "okio/Okio")
|
||||
/* loaded from: classes11.dex */
|
||||
final /* synthetic */ class Okio__JvmOkioKt {
|
||||
private static final Logger logger = Logger.getLogger("okio.Okio");
|
||||
|
||||
public static final Sink sink(File file) throws FileNotFoundException {
|
||||
return sink$default(file, false, 1, null);
|
||||
}
|
||||
|
||||
public static final Sink sink(OutputStream sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "$this$sink");
|
||||
return new sink(sink, new Timeout());
|
||||
}
|
||||
|
||||
public static final Source source(InputStream source) {
|
||||
Intrinsics.checkNotNullParameter(source, "$this$source");
|
||||
return new source(source, new Timeout());
|
||||
}
|
||||
|
||||
public static final Sink sink(Socket sink) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(sink, "$this$sink");
|
||||
SocketAsyncTimeout timeout = new SocketAsyncTimeout(sink);
|
||||
OutputStream outputStream = sink.getOutputStream();
|
||||
Intrinsics.checkNotNullExpressionValue(outputStream, "getOutputStream()");
|
||||
return timeout.sink(new sink(outputStream, timeout));
|
||||
}
|
||||
|
||||
public static final Source source(Socket source) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(source, "$this$source");
|
||||
SocketAsyncTimeout timeout = new SocketAsyncTimeout(source);
|
||||
InputStream inputStream = source.getInputStream();
|
||||
Intrinsics.checkNotNullExpressionValue(inputStream, "getInputStream()");
|
||||
return timeout.source(new source(inputStream, timeout));
|
||||
}
|
||||
|
||||
public static final Sink sink(File sink, boolean append) throws FileNotFoundException {
|
||||
Intrinsics.checkNotNullParameter(sink, "$this$sink");
|
||||
return Okio.sink(new FileOutputStream(sink, append));
|
||||
}
|
||||
|
||||
public static /* synthetic */ Sink sink$default(File file, boolean z, int i, Object obj) throws FileNotFoundException {
|
||||
if ((i & 1) != 0) {
|
||||
z = false;
|
||||
}
|
||||
return Okio.sink(file, z);
|
||||
}
|
||||
|
||||
public static final Sink appendingSink(File appendingSink) throws FileNotFoundException {
|
||||
Intrinsics.checkNotNullParameter(appendingSink, "$this$appendingSink");
|
||||
return Okio.sink(new FileOutputStream(appendingSink, true));
|
||||
}
|
||||
|
||||
public static final Source source(File source) throws FileNotFoundException {
|
||||
Intrinsics.checkNotNullParameter(source, "$this$source");
|
||||
return Okio.source(new FileInputStream(source));
|
||||
}
|
||||
|
||||
public static final Sink sink(Path sink, OpenOption... options) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(sink, "$this$sink");
|
||||
Intrinsics.checkNotNullParameter(options, "options");
|
||||
OutputStream newOutputStream = Files.newOutputStream(sink, (OpenOption[]) Arrays.copyOf(options, options.length));
|
||||
Intrinsics.checkNotNullExpressionValue(newOutputStream, "Files.newOutputStream(this, *options)");
|
||||
return Okio.sink(newOutputStream);
|
||||
}
|
||||
|
||||
public static final Source source(Path source, OpenOption... options) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(source, "$this$source");
|
||||
Intrinsics.checkNotNullParameter(options, "options");
|
||||
InputStream newInputStream = Files.newInputStream(source, (OpenOption[]) Arrays.copyOf(options, options.length));
|
||||
Intrinsics.checkNotNullExpressionValue(newInputStream, "Files.newInputStream(this, *options)");
|
||||
return Okio.source(newInputStream);
|
||||
}
|
||||
|
||||
public static final boolean isAndroidGetsocknameError(AssertionError isAndroidGetsocknameError) {
|
||||
Intrinsics.checkNotNullParameter(isAndroidGetsocknameError, "$this$isAndroidGetsocknameError");
|
||||
if (isAndroidGetsocknameError.getCause() == null) {
|
||||
return false;
|
||||
}
|
||||
String message = isAndroidGetsocknameError.getMessage();
|
||||
return message != null ? StringsKt.contains$default((CharSequence) message, (CharSequence) "getsockname failed", false, 2, (Object) null) : false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package okio;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Okio.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u0018\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u001a\r\u0010\u0000\u001a\u00020\u0001H\u0007¢\u0006\u0002\b\u0002\u001a\n\u0010\u0003\u001a\u00020\u0004*\u00020\u0001\u001a\n\u0010\u0003\u001a\u00020\u0005*\u00020\u0006¨\u0006\u0007"}, m238d2 = {"blackholeSink", "Lokio/Sink;", "blackhole", "buffer", "Lokio/BufferedSink;", "Lokio/BufferedSource;", "Lokio/Source;", "okio"}, m239k = 5, m240mv = {1, 4, 0}, m243xs = "okio/Okio")
|
||||
/* loaded from: classes11.dex */
|
||||
final /* synthetic */ class Okio__OkioKt {
|
||||
public static final BufferedSource buffer(Source buffer) {
|
||||
Intrinsics.checkNotNullParameter(buffer, "$this$buffer");
|
||||
return new buffer(buffer);
|
||||
}
|
||||
|
||||
public static final BufferedSink buffer(Sink buffer) {
|
||||
Intrinsics.checkNotNullParameter(buffer, "$this$buffer");
|
||||
return new buffer(buffer);
|
||||
}
|
||||
|
||||
public static final Sink blackhole() {
|
||||
return new BlackholeSink();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
package okio;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.RandomAccess;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.AbstractList;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
|
||||
/* compiled from: Options.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0000\n\u0002\u0010\u0015\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\b\u0018\u0000 \u00152\b\u0012\u0004\u0012\u00020\u00020\u00012\u00060\u0003j\u0002`\u0004:\u0001\u0015B\u001f\b\u0002\u0012\u000e\u0010\u0005\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00020\b¢\u0006\u0002\u0010\tJ\u0011\u0010\u0013\u001a\u00020\u00022\u0006\u0010\u0014\u001a\u00020\u000eH\u0096\u0002R\u001e\u0010\u0005\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00020\u0006X\u0080\u0004¢\u0006\n\n\u0002\u0010\f\u001a\u0004\b\n\u0010\u000bR\u0014\u0010\r\u001a\u00020\u000e8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u000f\u0010\u0010R\u0014\u0010\u0007\u001a\u00020\bX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0011\u0010\u0012¨\u0006\u0016"}, m238d2 = {"Lokio/Options;", "Lkotlin/collections/AbstractList;", "Lokio/ByteString;", "Ljava/util/RandomAccess;", "Lkotlin/collections/RandomAccess;", "byteStrings", "", "trie", "", "([Lokio/ByteString;[I)V", "getByteStrings$okio", "()[Lokio/ByteString;", "[Lokio/ByteString;", "size", "", "getSize", "()I", "getTrie$okio", "()[I", "get", "index", "Companion", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Options extends AbstractList<ByteString> implements RandomAccess {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private final ByteString[] byteStrings;
|
||||
private final int[] trie;
|
||||
|
||||
@JvmStatic
|
||||
/* renamed from: of */
|
||||
public static final Options m270of(ByteString... byteStringArr) {
|
||||
return INSTANCE.m271of(byteStringArr);
|
||||
}
|
||||
|
||||
private Options(ByteString[] byteStrings, int[] trie) {
|
||||
this.byteStrings = byteStrings;
|
||||
this.trie = trie;
|
||||
}
|
||||
|
||||
public /* synthetic */ Options(ByteString[] byteStrings, int[] trie, DefaultConstructorMarker $constructor_marker) {
|
||||
this(byteStrings, trie);
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.AbstractCollection, java.util.Collection
|
||||
public final /* bridge */ boolean contains(Object obj) {
|
||||
if (obj instanceof ByteString) {
|
||||
return contains((ByteString) obj);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public /* bridge */ boolean contains(ByteString byteString) {
|
||||
return super.contains((Object) byteString);
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.AbstractList, java.util.List
|
||||
public final /* bridge */ int indexOf(Object obj) {
|
||||
if (obj instanceof ByteString) {
|
||||
return indexOf((ByteString) obj);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public /* bridge */ int indexOf(ByteString byteString) {
|
||||
return super.indexOf((Object) byteString);
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.AbstractList, java.util.List
|
||||
public final /* bridge */ int lastIndexOf(Object obj) {
|
||||
if (obj instanceof ByteString) {
|
||||
return lastIndexOf((ByteString) obj);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public /* bridge */ int lastIndexOf(ByteString byteString) {
|
||||
return super.lastIndexOf((Object) byteString);
|
||||
}
|
||||
|
||||
/* renamed from: getByteStrings$okio, reason: from getter */
|
||||
public final ByteString[] getByteStrings() {
|
||||
return this.byteStrings;
|
||||
}
|
||||
|
||||
/* renamed from: getTrie$okio, reason: from getter */
|
||||
public final int[] getTrie() {
|
||||
return this.trie;
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.AbstractList, kotlin.collections.AbstractCollection
|
||||
/* renamed from: getSize */
|
||||
public int get_size() {
|
||||
return this.byteStrings.length;
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.AbstractList, java.util.List
|
||||
public ByteString get(int index) {
|
||||
return this.byteStrings[index];
|
||||
}
|
||||
|
||||
/* compiled from: Options.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0010\u0011\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002JT\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\n\u001a\u00020\u00042\u0006\u0010\u000b\u001a\u00020\u00052\b\b\u0002\u0010\f\u001a\u00020\r2\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00020\u00100\u000f2\b\b\u0002\u0010\u0011\u001a\u00020\r2\b\b\u0002\u0010\u0012\u001a\u00020\r2\f\u0010\u0013\u001a\b\u0012\u0004\u0012\u00020\r0\u000fH\u0002J!\u0010\u0014\u001a\u00020\u00152\u0012\u0010\u000e\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00100\u0016\"\u00020\u0010H\u0007¢\u0006\u0002\u0010\u0017R\u0018\u0010\u0003\u001a\u00020\u0004*\u00020\u00058BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0007¨\u0006\u0018"}, m238d2 = {"Lokio/Options$Companion;", "", "()V", "intCount", "", "Lokio/Buffer;", "getIntCount", "(Lokio/Buffer;)J", "buildTrieRecursive", "", "nodeOffset", "node", "byteStringOffset", "", "byteStrings", "", "Lokio/ByteString;", "fromIndex", "toIndex", "indexes", "of", "Lokio/Options;", "", "([Lokio/ByteString;)Lokio/Options;", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
public static final class Companion {
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
|
||||
this();
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:48:0x0114, code lost:
|
||||
|
||||
continue;
|
||||
*/
|
||||
@kotlin.jvm.JvmStatic
|
||||
/* renamed from: of */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final okio.Options m271of(okio.ByteString... r22) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 388
|
||||
To view this dump add '--comments-level debug' option
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: okio.Options.Companion.m271of(okio.ByteString[]):okio.Options");
|
||||
}
|
||||
|
||||
static /* synthetic */ void buildTrieRecursive$default(Companion companion, long j, Buffer buffer, int i, List list, int i2, int i3, List list2, int i4, Object obj) {
|
||||
companion.buildTrieRecursive((i4 & 1) != 0 ? 0L : j, buffer, (i4 & 4) != 0 ? 0 : i, list, (i4 & 16) != 0 ? 0 : i2, (i4 & 32) != 0 ? list.size() : i3, list2);
|
||||
}
|
||||
|
||||
private final void buildTrieRecursive(long nodeOffset, Buffer node, int byteStringOffset, List<? extends ByteString> byteStrings, int fromIndex, int toIndex, List<Integer> indexes) {
|
||||
int fromIndex2;
|
||||
ByteString from;
|
||||
int prefixIndex;
|
||||
ByteString from2;
|
||||
int rangeEnd;
|
||||
Buffer childNodes;
|
||||
int selectChoiceCount;
|
||||
int prefixIndex2;
|
||||
ByteString from3;
|
||||
int fromIndex3;
|
||||
List<Integer> list = indexes;
|
||||
if (!(fromIndex < toIndex)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
for (int i = fromIndex; i < toIndex; i++) {
|
||||
if (!(byteStrings.get(i).size() >= byteStringOffset)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
}
|
||||
ByteString from4 = byteStrings.get(fromIndex);
|
||||
ByteString to = byteStrings.get(toIndex - 1);
|
||||
if (byteStringOffset != from4.size()) {
|
||||
fromIndex2 = fromIndex;
|
||||
from = from4;
|
||||
prefixIndex = -1;
|
||||
} else {
|
||||
int prefixIndex3 = list.get(fromIndex).intValue();
|
||||
int fromIndex4 = fromIndex + 1;
|
||||
fromIndex2 = fromIndex4;
|
||||
from = byteStrings.get(fromIndex4);
|
||||
prefixIndex = prefixIndex3;
|
||||
}
|
||||
if (from.getByte(byteStringOffset) != to.getByte(byteStringOffset)) {
|
||||
int i2 = fromIndex2 + 1;
|
||||
int selectChoiceCount2 = 1;
|
||||
while (i2 < toIndex) {
|
||||
int i3 = i2;
|
||||
if (byteStrings.get(i3 - 1).getByte(byteStringOffset) != byteStrings.get(i3).getByte(byteStringOffset)) {
|
||||
selectChoiceCount2++;
|
||||
}
|
||||
i2 = i3 + 1;
|
||||
}
|
||||
long childNodesOffset = nodeOffset + getIntCount(node) + 2 + (selectChoiceCount2 * 2);
|
||||
node.writeInt(selectChoiceCount2);
|
||||
node.writeInt(prefixIndex);
|
||||
for (int i4 = fromIndex2; i4 < toIndex; i4++) {
|
||||
byte rangeByte = byteStrings.get(i4).getByte(byteStringOffset);
|
||||
if (i4 == fromIndex2 || rangeByte != byteStrings.get(i4 - 1).getByte(byteStringOffset)) {
|
||||
int other$iv = 255 & rangeByte;
|
||||
node.writeInt(other$iv);
|
||||
}
|
||||
}
|
||||
Buffer childNodes2 = new Buffer();
|
||||
int rangeStart = fromIndex2;
|
||||
while (rangeStart < toIndex) {
|
||||
byte rangeByte2 = byteStrings.get(rangeStart).getByte(byteStringOffset);
|
||||
int rangeEnd2 = toIndex;
|
||||
int i5 = rangeStart + 1;
|
||||
while (true) {
|
||||
if (i5 >= toIndex) {
|
||||
i5 = rangeEnd2;
|
||||
break;
|
||||
}
|
||||
int rangeEnd3 = rangeEnd2;
|
||||
if (rangeByte2 != byteStrings.get(i5).getByte(byteStringOffset)) {
|
||||
break;
|
||||
}
|
||||
i5++;
|
||||
rangeEnd2 = rangeEnd3;
|
||||
}
|
||||
if (rangeStart + 1 == i5 && byteStringOffset + 1 == byteStrings.get(rangeStart).size()) {
|
||||
node.writeInt(list.get(rangeStart).intValue());
|
||||
rangeEnd = i5;
|
||||
childNodes = childNodes2;
|
||||
selectChoiceCount = selectChoiceCount2;
|
||||
prefixIndex2 = prefixIndex;
|
||||
from3 = from;
|
||||
fromIndex3 = fromIndex2;
|
||||
rangeStart = rangeEnd;
|
||||
fromIndex2 = fromIndex3;
|
||||
prefixIndex = prefixIndex2;
|
||||
selectChoiceCount2 = selectChoiceCount;
|
||||
childNodes2 = childNodes;
|
||||
from = from3;
|
||||
list = indexes;
|
||||
}
|
||||
node.writeInt(((int) (childNodesOffset + getIntCount(childNodes2))) * (-1));
|
||||
int selectChoiceCount3 = byteStringOffset + 1;
|
||||
rangeEnd = i5;
|
||||
childNodes = childNodes2;
|
||||
selectChoiceCount = selectChoiceCount2;
|
||||
prefixIndex2 = prefixIndex;
|
||||
from3 = from;
|
||||
fromIndex3 = fromIndex2;
|
||||
buildTrieRecursive(childNodesOffset, childNodes2, selectChoiceCount3, byteStrings, rangeStart, rangeEnd, indexes);
|
||||
rangeStart = rangeEnd;
|
||||
fromIndex2 = fromIndex3;
|
||||
prefixIndex = prefixIndex2;
|
||||
selectChoiceCount2 = selectChoiceCount;
|
||||
childNodes2 = childNodes;
|
||||
from = from3;
|
||||
list = indexes;
|
||||
}
|
||||
node.writeAll(childNodes2);
|
||||
return;
|
||||
}
|
||||
int prefixIndex4 = prefixIndex;
|
||||
ByteString from5 = from;
|
||||
int fromIndex5 = fromIndex2;
|
||||
int min = Math.min(from5.size(), to.size());
|
||||
int scanByteCount = 0;
|
||||
int scanByteCount2 = byteStringOffset;
|
||||
while (true) {
|
||||
if (scanByteCount2 >= min) {
|
||||
from2 = from5;
|
||||
break;
|
||||
}
|
||||
from2 = from5;
|
||||
if (from2.getByte(scanByteCount2) != to.getByte(scanByteCount2)) {
|
||||
break;
|
||||
}
|
||||
scanByteCount++;
|
||||
scanByteCount2++;
|
||||
from5 = from2;
|
||||
}
|
||||
long childNodesOffset2 = nodeOffset + getIntCount(node) + 2 + scanByteCount + 1;
|
||||
node.writeInt(-scanByteCount);
|
||||
node.writeInt(prefixIndex4);
|
||||
int i6 = byteStringOffset + scanByteCount;
|
||||
for (int i7 = byteStringOffset; i7 < i6; i7++) {
|
||||
byte $this$and$iv = from2.getByte(i7);
|
||||
node.writeInt($this$and$iv & 255);
|
||||
}
|
||||
if (fromIndex5 + 1 != toIndex) {
|
||||
Buffer childNodes3 = new Buffer();
|
||||
node.writeInt(((int) (childNodesOffset2 + getIntCount(childNodes3))) * (-1));
|
||||
buildTrieRecursive(childNodesOffset2, childNodes3, byteStringOffset + scanByteCount, byteStrings, fromIndex5, toIndex, indexes);
|
||||
node.writeAll(childNodes3);
|
||||
return;
|
||||
}
|
||||
if (byteStringOffset + scanByteCount == byteStrings.get(fromIndex5).size()) {
|
||||
node.writeInt(indexes.get(fromIndex5).intValue());
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
|
||||
private final long getIntCount(Buffer $this$intCount) {
|
||||
return $this$intCount.size() / 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package okio;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: PeekSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\u000f\u001a\u00020\u0010H\u0016J\u0018\u0010\u0011\u001a\u00020\u000e2\u0006\u0010\u0012\u001a\u00020\u00062\u0006\u0010\u0013\u001a\u00020\u000eH\u0016J\b\u0010\u0014\u001a\u00020\u0015H\u0016R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0016"}, m238d2 = {"Lokio/PeekSource;", "Lokio/Source;", "upstream", "Lokio/BufferedSource;", "(Lokio/BufferedSource;)V", "buffer", "Lokio/Buffer;", "closed", "", "expectedPos", "", "expectedSegment", "Lokio/Segment;", "pos", "", "close", "", "read", "sink", "byteCount", "timeout", "Lokio/Timeout;", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class PeekSource implements Source {
|
||||
private final Buffer buffer;
|
||||
private boolean closed;
|
||||
private int expectedPos;
|
||||
private Segment expectedSegment;
|
||||
private long pos;
|
||||
private final BufferedSource upstream;
|
||||
|
||||
public PeekSource(BufferedSource upstream) {
|
||||
Intrinsics.checkNotNullParameter(upstream, "upstream");
|
||||
this.upstream = upstream;
|
||||
Buffer buffer = upstream.getBuffer();
|
||||
this.buffer = buffer;
|
||||
this.expectedSegment = buffer.head;
|
||||
Segment segment = buffer.head;
|
||||
this.expectedPos = segment != null ? segment.pos : -1;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:12:0x002d, code lost:
|
||||
|
||||
if (r2 == r5.pos) goto L15;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:14:0x0032 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:28:0x007e */
|
||||
@Override // okio.Source
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public long read(okio.Buffer r9, long r10) {
|
||||
/*
|
||||
r8 = this;
|
||||
java.lang.String r0 = "sink"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r9, r0)
|
||||
r0 = 0
|
||||
int r2 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
|
||||
r3 = 0
|
||||
r4 = 1
|
||||
if (r2 < 0) goto Lf
|
||||
r2 = r4
|
||||
goto L10
|
||||
Lf:
|
||||
r2 = r3
|
||||
L10:
|
||||
if (r2 == 0) goto L9e
|
||||
boolean r2 = r8.closed
|
||||
r2 = r2 ^ r4
|
||||
if (r2 == 0) goto L8e
|
||||
L18:
|
||||
okio.Segment r2 = r8.expectedSegment
|
||||
if (r2 == 0) goto L2f
|
||||
okio.Buffer r5 = r8.buffer
|
||||
okio.Segment r5 = r5.head
|
||||
if (r2 != r5) goto L30
|
||||
int r2 = r8.expectedPos
|
||||
okio.Buffer r5 = r8.buffer
|
||||
okio.Segment r5 = r5.head
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r5)
|
||||
int r5 = r5.pos
|
||||
if (r2 != r5) goto L30
|
||||
L2f:
|
||||
r3 = r4
|
||||
L30:
|
||||
if (r3 == 0) goto L7e
|
||||
int r2 = (r10 > r0 ? 1 : (r10 == r0 ? 0 : -1))
|
||||
if (r2 != 0) goto L37
|
||||
return r0
|
||||
L37:
|
||||
okio.BufferedSource r0 = r8.upstream
|
||||
long r1 = r8.pos
|
||||
r3 = 1
|
||||
long r1 = r1 + r3
|
||||
boolean r0 = r0.request(r1)
|
||||
if (r0 != 0) goto L47
|
||||
r0 = -1
|
||||
return r0
|
||||
L47:
|
||||
okio.Segment r0 = r8.expectedSegment
|
||||
if (r0 != 0) goto L62
|
||||
okio.Buffer r0 = r8.buffer
|
||||
okio.Segment r0 = r0.head
|
||||
if (r0 == 0) goto L62
|
||||
okio.Buffer r0 = r8.buffer
|
||||
okio.Segment r0 = r0.head
|
||||
r8.expectedSegment = r0
|
||||
okio.Buffer r0 = r8.buffer
|
||||
okio.Segment r0 = r0.head
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
|
||||
int r0 = r0.pos
|
||||
r8.expectedPos = r0
|
||||
L62:
|
||||
okio.Buffer r0 = r8.buffer
|
||||
long r0 = r0.size()
|
||||
long r2 = r8.pos
|
||||
long r0 = r0 - r2
|
||||
long r0 = java.lang.Math.min(r10, r0)
|
||||
okio.Buffer r2 = r8.buffer
|
||||
long r4 = r8.pos
|
||||
r3 = r9
|
||||
r6 = r0
|
||||
r2.copyTo(r3, r4, r6)
|
||||
long r2 = r8.pos
|
||||
long r2 = r2 + r0
|
||||
r8.pos = r2
|
||||
return r0
|
||||
L7e:
|
||||
r0 = 0
|
||||
java.lang.IllegalStateException r0 = new java.lang.IllegalStateException
|
||||
java.lang.String r1 = "Peek source is invalid because upstream source was used"
|
||||
java.lang.String r1 = r1.toString()
|
||||
r0.<init>(r1)
|
||||
java.lang.Throwable r0 = (java.lang.Throwable) r0
|
||||
throw r0
|
||||
L8e:
|
||||
r0 = 0
|
||||
java.lang.IllegalStateException r0 = new java.lang.IllegalStateException
|
||||
java.lang.String r1 = "closed"
|
||||
java.lang.String r1 = r1.toString()
|
||||
r0.<init>(r1)
|
||||
java.lang.Throwable r0 = (java.lang.Throwable) r0
|
||||
throw r0
|
||||
L9e:
|
||||
r0 = 0
|
||||
java.lang.StringBuilder r1 = new java.lang.StringBuilder
|
||||
r1.<init>()
|
||||
java.lang.String r2 = "byteCount < 0: "
|
||||
r1.append(r2)
|
||||
r1.append(r10)
|
||||
java.lang.String r0 = r1.toString()
|
||||
java.lang.IllegalArgumentException r1 = new java.lang.IllegalArgumentException
|
||||
java.lang.String r0 = r0.toString()
|
||||
r1.<init>(r0)
|
||||
java.lang.Throwable r1 = (java.lang.Throwable) r1
|
||||
throw r1
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: okio.PeekSource.read(okio.Buffer, long):long");
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
/* renamed from: timeout */
|
||||
public Timeout getTimeout() {
|
||||
return this.upstream.getTimeout();
|
||||
}
|
||||
|
||||
@Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
this.closed = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,475 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecationLevel;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Pipe.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000D\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0006\u0010!\u001a\u00020\"J\u000e\u0010#\u001a\u00020\"2\u0006\u0010\u0017\u001a\u00020\u0010J\r\u0010\u0017\u001a\u00020\u0010H\u0007¢\u0006\u0002\b$J\r\u0010\u001b\u001a\u00020\u001cH\u0007¢\u0006\u0002\b%J&\u0010&\u001a\u00020\"*\u00020\u00102\u0017\u0010'\u001a\u0013\u0012\u0004\u0012\u00020\u0010\u0012\u0004\u0012\u00020\"0(¢\u0006\u0002\b)H\u0082\bR\u0014\u0010\u0005\u001a\u00020\u0006X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\bR\u001a\u0010\t\u001a\u00020\nX\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u001c\u0010\u000f\u001a\u0004\u0018\u00010\u0010X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R\u0014\u0010\u0002\u001a\u00020\u0003X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0015\u0010\u0016R\u0013\u0010\u0017\u001a\u00020\u00108G¢\u0006\b\n\u0000\u001a\u0004\b\u0017\u0010\u0012R\u001a\u0010\u0018\u001a\u00020\nX\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0019\u0010\f\"\u0004\b\u001a\u0010\u000eR\u0013\u0010\u001b\u001a\u00020\u001c8G¢\u0006\b\n\u0000\u001a\u0004\b\u001b\u0010\u001dR\u001a\u0010\u001e\u001a\u00020\nX\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001f\u0010\f\"\u0004\b \u0010\u000e¨\u0006*"}, m238d2 = {"Lokio/Pipe;", "", "maxBufferSize", "", "(J)V", "buffer", "Lokio/Buffer;", "getBuffer$okio", "()Lokio/Buffer;", "canceled", "", "getCanceled$okio", "()Z", "setCanceled$okio", "(Z)V", "foldedSink", "Lokio/Sink;", "getFoldedSink$okio", "()Lokio/Sink;", "setFoldedSink$okio", "(Lokio/Sink;)V", "getMaxBufferSize$okio", "()J", "sink", "sinkClosed", "getSinkClosed$okio", "setSinkClosed$okio", "source", "Lokio/Source;", "()Lokio/Source;", "sourceClosed", "getSourceClosed$okio", "setSourceClosed$okio", "cancel", "", "fold", "-deprecated_sink", "-deprecated_source", "forward", "block", "Lkotlin/Function1;", "Lkotlin/ExtensionFunctionType;", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Pipe {
|
||||
private final Buffer buffer = new Buffer();
|
||||
private boolean canceled;
|
||||
private Sink foldedSink;
|
||||
private final long maxBufferSize;
|
||||
private final Sink sink;
|
||||
private boolean sinkClosed;
|
||||
private final Source source;
|
||||
private boolean sourceClosed;
|
||||
|
||||
public Pipe(long maxBufferSize) {
|
||||
this.maxBufferSize = maxBufferSize;
|
||||
if (!(maxBufferSize >= 1)) {
|
||||
throw new IllegalArgumentException(("maxBufferSize < 1: " + maxBufferSize).toString());
|
||||
}
|
||||
this.sink = new Sink() { // from class: okio.Pipe$sink$1
|
||||
private final Timeout timeout = new Timeout();
|
||||
|
||||
@Override // okio.Sink
|
||||
public void write(Buffer source, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
long byteCount2 = byteCount;
|
||||
Sink sink = (Sink) null;
|
||||
Object lock$iv = Pipe.this.getBuffer();
|
||||
synchronized (lock$iv) {
|
||||
if (!(!Pipe.this.getSinkClosed())) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (Pipe.this.getCanceled()) {
|
||||
throw new IOException("canceled");
|
||||
}
|
||||
while (true) {
|
||||
if (byteCount2 <= 0) {
|
||||
break;
|
||||
}
|
||||
Sink it = Pipe.this.getFoldedSink();
|
||||
if (it != null) {
|
||||
sink = it;
|
||||
break;
|
||||
}
|
||||
if (Pipe.this.getSourceClosed()) {
|
||||
throw new IOException("source is closed");
|
||||
}
|
||||
long bufferSpaceAvailable = Pipe.this.getMaxBufferSize() - Pipe.this.getBuffer().size();
|
||||
if (bufferSpaceAvailable == 0) {
|
||||
this.timeout.waitUntilNotified(Pipe.this.getBuffer());
|
||||
if (Pipe.this.getCanceled()) {
|
||||
throw new IOException("canceled");
|
||||
}
|
||||
} else {
|
||||
long bytesToWrite = Math.min(bufferSpaceAvailable, byteCount2);
|
||||
Pipe.this.getBuffer().write(source, bytesToWrite);
|
||||
byteCount2 -= bytesToWrite;
|
||||
Buffer buffer = Pipe.this.getBuffer();
|
||||
if (buffer == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
buffer.notifyAll();
|
||||
}
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
if (sink == null) {
|
||||
return;
|
||||
}
|
||||
Pipe this_$iv = Pipe.this;
|
||||
Sink $this$forward$iv = sink;
|
||||
Timeout this_$iv$iv = $this$forward$iv.getTimeout();
|
||||
Timeout other$iv$iv = this_$iv.sink().getTimeout();
|
||||
long originalTimeout$iv$iv = this_$iv$iv.getTimeoutNanos();
|
||||
this_$iv$iv.timeout(Timeout.INSTANCE.minTimeout(other$iv$iv.getTimeoutNanos(), this_$iv$iv.getTimeoutNanos()), TimeUnit.NANOSECONDS);
|
||||
if (this_$iv$iv.getHasDeadline()) {
|
||||
long originalDeadline$iv$iv = this_$iv$iv.deadlineNanoTime();
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(Math.min(this_$iv$iv.deadlineNanoTime(), other$iv$iv.deadlineNanoTime()));
|
||||
}
|
||||
try {
|
||||
$this$forward$iv.write(source, byteCount2);
|
||||
this_$iv$iv.timeout(originalTimeout$iv$iv, TimeUnit.NANOSECONDS);
|
||||
if (!other$iv$iv.getHasDeadline()) {
|
||||
return;
|
||||
}
|
||||
this_$iv$iv.deadlineNanoTime(originalDeadline$iv$iv);
|
||||
} finally {
|
||||
}
|
||||
} else {
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(other$iv$iv.deadlineNanoTime());
|
||||
}
|
||||
try {
|
||||
$this$forward$iv.write(source, byteCount2);
|
||||
this_$iv$iv.timeout(originalTimeout$iv$iv, TimeUnit.NANOSECONDS);
|
||||
if (!other$iv$iv.getHasDeadline()) {
|
||||
return;
|
||||
}
|
||||
this_$iv$iv.clearDeadline();
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
public void flush() {
|
||||
boolean hasDeadline;
|
||||
Sink sink = (Sink) null;
|
||||
Object lock$iv = Pipe.this.getBuffer();
|
||||
synchronized (lock$iv) {
|
||||
if (!(!Pipe.this.getSinkClosed())) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (Pipe.this.getCanceled()) {
|
||||
throw new IOException("canceled");
|
||||
}
|
||||
Sink it = Pipe.this.getFoldedSink();
|
||||
if (it != null) {
|
||||
sink = it;
|
||||
} else if (Pipe.this.getSourceClosed() && Pipe.this.getBuffer().size() > 0) {
|
||||
throw new IOException("source is closed");
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
if (sink == null) {
|
||||
return;
|
||||
}
|
||||
Pipe this_$iv = Pipe.this;
|
||||
Sink $this$forward$iv = sink;
|
||||
Timeout this_$iv$iv = $this$forward$iv.getTimeout();
|
||||
Timeout other$iv$iv = this_$iv.sink().getTimeout();
|
||||
long originalTimeout$iv$iv = this_$iv$iv.getTimeoutNanos();
|
||||
this_$iv$iv.timeout(Timeout.INSTANCE.minTimeout(other$iv$iv.getTimeoutNanos(), this_$iv$iv.getTimeoutNanos()), TimeUnit.NANOSECONDS);
|
||||
if (this_$iv$iv.getHasDeadline()) {
|
||||
long originalDeadline$iv$iv = this_$iv$iv.deadlineNanoTime();
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(Math.min(this_$iv$iv.deadlineNanoTime(), other$iv$iv.deadlineNanoTime()));
|
||||
}
|
||||
try {
|
||||
$this$forward$iv.flush();
|
||||
if (hasDeadline) {
|
||||
return;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} finally {
|
||||
this_$iv$iv.timeout(originalTimeout$iv$iv, TimeUnit.NANOSECONDS);
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(originalDeadline$iv$iv);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(other$iv$iv.deadlineNanoTime());
|
||||
}
|
||||
try {
|
||||
$this$forward$iv.flush();
|
||||
} finally {
|
||||
this_$iv$iv.timeout(originalTimeout$iv$iv, TimeUnit.NANOSECONDS);
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.clearDeadline();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
boolean hasDeadline;
|
||||
Sink sink = (Sink) null;
|
||||
Object lock$iv = Pipe.this.getBuffer();
|
||||
synchronized (lock$iv) {
|
||||
if (Pipe.this.getSinkClosed()) {
|
||||
return;
|
||||
}
|
||||
Sink it = Pipe.this.getFoldedSink();
|
||||
if (it != null) {
|
||||
sink = it;
|
||||
} else {
|
||||
if (Pipe.this.getSourceClosed() && Pipe.this.getBuffer().size() > 0) {
|
||||
throw new IOException("source is closed");
|
||||
}
|
||||
Pipe.this.setSinkClosed$okio(true);
|
||||
Buffer buffer = Pipe.this.getBuffer();
|
||||
if (buffer == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
buffer.notifyAll();
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
if (sink == null) {
|
||||
return;
|
||||
}
|
||||
Pipe this_$iv = Pipe.this;
|
||||
Sink $this$forward$iv = sink;
|
||||
Timeout this_$iv$iv = $this$forward$iv.getTimeout();
|
||||
Timeout other$iv$iv = this_$iv.sink().getTimeout();
|
||||
long originalTimeout$iv$iv = this_$iv$iv.getTimeoutNanos();
|
||||
this_$iv$iv.timeout(Timeout.INSTANCE.minTimeout(other$iv$iv.getTimeoutNanos(), this_$iv$iv.getTimeoutNanos()), TimeUnit.NANOSECONDS);
|
||||
if (this_$iv$iv.getHasDeadline()) {
|
||||
long originalDeadline$iv$iv = this_$iv$iv.deadlineNanoTime();
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(Math.min(this_$iv$iv.deadlineNanoTime(), other$iv$iv.deadlineNanoTime()));
|
||||
}
|
||||
try {
|
||||
$this$forward$iv.close();
|
||||
if (hasDeadline) {
|
||||
return;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} finally {
|
||||
this_$iv$iv.timeout(originalTimeout$iv$iv, TimeUnit.NANOSECONDS);
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(originalDeadline$iv$iv);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.deadlineNanoTime(other$iv$iv.deadlineNanoTime());
|
||||
}
|
||||
try {
|
||||
$this$forward$iv.close();
|
||||
} finally {
|
||||
this_$iv$iv.timeout(originalTimeout$iv$iv, TimeUnit.NANOSECONDS);
|
||||
if (other$iv$iv.getHasDeadline()) {
|
||||
this_$iv$iv.clearDeadline();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
/* renamed from: timeout, reason: from getter */
|
||||
public Timeout getTimeout() {
|
||||
return this.timeout;
|
||||
}
|
||||
};
|
||||
this.source = new Source() { // from class: okio.Pipe$source$1
|
||||
private final Timeout timeout = new Timeout();
|
||||
|
||||
@Override // okio.Source
|
||||
public long read(Buffer sink, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Object lock$iv = Pipe.this.getBuffer();
|
||||
synchronized (lock$iv) {
|
||||
if (!(!Pipe.this.getSourceClosed())) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (Pipe.this.getCanceled()) {
|
||||
throw new IOException("canceled");
|
||||
}
|
||||
while (Pipe.this.getBuffer().size() == 0) {
|
||||
if (Pipe.this.getSinkClosed()) {
|
||||
return -1L;
|
||||
}
|
||||
this.timeout.waitUntilNotified(Pipe.this.getBuffer());
|
||||
if (Pipe.this.getCanceled()) {
|
||||
throw new IOException("canceled");
|
||||
}
|
||||
}
|
||||
long read = Pipe.this.getBuffer().read(sink, byteCount);
|
||||
Buffer buffer = Pipe.this.getBuffer();
|
||||
if (buffer == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
buffer.notifyAll();
|
||||
return read;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
Object lock$iv = Pipe.this.getBuffer();
|
||||
synchronized (lock$iv) {
|
||||
Pipe.this.setSourceClosed$okio(true);
|
||||
Buffer buffer = Pipe.this.getBuffer();
|
||||
if (buffer == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
buffer.notifyAll();
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
/* renamed from: timeout, reason: from getter */
|
||||
public Timeout getTimeout() {
|
||||
return this.timeout;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/* renamed from: getMaxBufferSize$okio, reason: from getter */
|
||||
public final long getMaxBufferSize() {
|
||||
return this.maxBufferSize;
|
||||
}
|
||||
|
||||
/* renamed from: getBuffer$okio, reason: from getter */
|
||||
public final Buffer getBuffer() {
|
||||
return this.buffer;
|
||||
}
|
||||
|
||||
/* renamed from: getCanceled$okio, reason: from getter */
|
||||
public final boolean getCanceled() {
|
||||
return this.canceled;
|
||||
}
|
||||
|
||||
public final void setCanceled$okio(boolean z) {
|
||||
this.canceled = z;
|
||||
}
|
||||
|
||||
/* renamed from: getSinkClosed$okio, reason: from getter */
|
||||
public final boolean getSinkClosed() {
|
||||
return this.sinkClosed;
|
||||
}
|
||||
|
||||
public final void setSinkClosed$okio(boolean z) {
|
||||
this.sinkClosed = z;
|
||||
}
|
||||
|
||||
/* renamed from: getSourceClosed$okio, reason: from getter */
|
||||
public final boolean getSourceClosed() {
|
||||
return this.sourceClosed;
|
||||
}
|
||||
|
||||
public final void setSourceClosed$okio(boolean z) {
|
||||
this.sourceClosed = z;
|
||||
}
|
||||
|
||||
/* renamed from: getFoldedSink$okio, reason: from getter */
|
||||
public final Sink getFoldedSink() {
|
||||
return this.foldedSink;
|
||||
}
|
||||
|
||||
public final void setFoldedSink$okio(Sink sink) {
|
||||
this.foldedSink = sink;
|
||||
}
|
||||
|
||||
public final Sink sink() {
|
||||
return this.sink;
|
||||
}
|
||||
|
||||
public final Source source() {
|
||||
return this.source;
|
||||
}
|
||||
|
||||
public final void fold(Sink sink) throws IOException {
|
||||
boolean closed;
|
||||
Buffer buffer;
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
while (true) {
|
||||
Object lock$iv = this.buffer;
|
||||
synchronized (lock$iv) {
|
||||
if (!(this.foldedSink == null)) {
|
||||
throw new IllegalStateException("sink already folded".toString());
|
||||
}
|
||||
if (this.canceled) {
|
||||
this.foldedSink = sink;
|
||||
throw new IOException("canceled");
|
||||
}
|
||||
if (this.buffer.exhausted()) {
|
||||
this.sourceClosed = true;
|
||||
this.foldedSink = sink;
|
||||
return;
|
||||
}
|
||||
closed = this.sinkClosed;
|
||||
buffer = new Buffer();
|
||||
Buffer buffer2 = this.buffer;
|
||||
buffer.write(buffer2, buffer2.size());
|
||||
Buffer buffer3 = this.buffer;
|
||||
if (buffer3 == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
buffer3.notifyAll();
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
try {
|
||||
sink.write(buffer, buffer.size());
|
||||
if (closed) {
|
||||
sink.close();
|
||||
} else {
|
||||
sink.flush();
|
||||
}
|
||||
} catch (Throwable th) {
|
||||
synchronized (this.buffer) {
|
||||
this.sourceClosed = true;
|
||||
Buffer buffer4 = this.buffer;
|
||||
if (buffer4 == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
buffer4.notifyAll();
|
||||
Unit unit2 = Unit.INSTANCE;
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final void forward(Sink $this$forward, Function1<? super Sink, Unit> function1) {
|
||||
Timeout this_$iv = $this$forward.getTimeout();
|
||||
Timeout other$iv = sink().getTimeout();
|
||||
long originalTimeout$iv = this_$iv.getTimeoutNanos();
|
||||
this_$iv.timeout(Timeout.INSTANCE.minTimeout(other$iv.getTimeoutNanos(), this_$iv.getTimeoutNanos()), TimeUnit.NANOSECONDS);
|
||||
if (this_$iv.getHasDeadline()) {
|
||||
long originalDeadline$iv = this_$iv.deadlineNanoTime();
|
||||
if (other$iv.getHasDeadline()) {
|
||||
this_$iv.deadlineNanoTime(Math.min(this_$iv.deadlineNanoTime(), other$iv.deadlineNanoTime()));
|
||||
}
|
||||
try {
|
||||
function1.invoke($this$forward);
|
||||
return;
|
||||
} finally {
|
||||
InlineMarker.finallyStart(1);
|
||||
this_$iv.timeout(originalTimeout$iv, TimeUnit.NANOSECONDS);
|
||||
if (other$iv.getHasDeadline()) {
|
||||
this_$iv.deadlineNanoTime(originalDeadline$iv);
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
}
|
||||
}
|
||||
if (other$iv.getHasDeadline()) {
|
||||
this_$iv.deadlineNanoTime(other$iv.deadlineNanoTime());
|
||||
}
|
||||
try {
|
||||
function1.invoke($this$forward);
|
||||
} finally {
|
||||
InlineMarker.finallyStart(1);
|
||||
this_$iv.timeout(originalTimeout$iv, TimeUnit.NANOSECONDS);
|
||||
if (other$iv.getHasDeadline()) {
|
||||
this_$iv.clearDeadline();
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "sink", imports = {}))
|
||||
/* renamed from: -deprecated_sink, reason: not valid java name and from getter */
|
||||
public final Sink getSink() {
|
||||
return this.sink;
|
||||
}
|
||||
|
||||
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "source", imports = {}))
|
||||
/* renamed from: -deprecated_source, reason: not valid java name and from getter */
|
||||
public final Source getSource() {
|
||||
return this.source;
|
||||
}
|
||||
|
||||
public final void cancel() {
|
||||
Object lock$iv = this.buffer;
|
||||
synchronized (lock$iv) {
|
||||
this.canceled = true;
|
||||
this.buffer.clear();
|
||||
Buffer buffer = this.buffer;
|
||||
if (buffer == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
buffer.notifyAll();
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package okio;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.Charsets;
|
||||
|
||||
/* compiled from: -Platform.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u00000\n\u0002\b\u0003\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a-\u0010\u0000\u001a\u0002H\u0001\"\u0004\b\u0000\u0010\u00012\u0006\u0010\u0002\u001a\u00020\u00032\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u0002H\u00010\u0005H\u0080\bø\u0001\u0000¢\u0006\u0002\u0010\u0006\u001a\f\u0010\u0007\u001a\u00020\b*\u00020\tH\u0000\u001a\f\u0010\n\u001a\u00020\t*\u00020\bH\u0000*\n\u0010\u000b\"\u00020\f2\u00020\f*\n\u0010\r\"\u00020\u000e2\u00020\u000e*\n\u0010\u000f\"\u00020\u00102\u00020\u0010\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u0011"}, m238d2 = {"synchronized", "R", "lock", "", "block", "Lkotlin/Function0;", "(Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "asUtf8ToByteArray", "", "", "toUtf8String", "ArrayIndexOutOfBoundsException", "Ljava/lang/ArrayIndexOutOfBoundsException;", "EOFException", "Ljava/io/EOFException;", "IOException", "Ljava/io/IOException;", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-Platform, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Platform {
|
||||
public static final String toUtf8String(byte[] toUtf8String) {
|
||||
Intrinsics.checkNotNullParameter(toUtf8String, "$this$toUtf8String");
|
||||
return new String(toUtf8String, Charsets.UTF_8);
|
||||
}
|
||||
|
||||
public static final byte[] asUtf8ToByteArray(String asUtf8ToByteArray) {
|
||||
Intrinsics.checkNotNullParameter(asUtf8ToByteArray, "$this$asUtf8ToByteArray");
|
||||
byte[] bytes = asUtf8ToByteArray.getBytes(Charsets.UTF_8);
|
||||
Intrinsics.checkNotNullExpressionValue(bytes, "(this as java.lang.String).getBytes(charset)");
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/* renamed from: synchronized, reason: not valid java name */
|
||||
public static final <R> R m1742synchronized(Object lock, Function0<? extends R> block) {
|
||||
R invoke;
|
||||
Intrinsics.checkNotNullParameter(lock, "lock");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
synchronized (lock) {
|
||||
try {
|
||||
invoke = block.invoke();
|
||||
InlineMarker.finallyStart(1);
|
||||
} catch (Throwable th) {
|
||||
InlineMarker.finallyStart(1);
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package okio;
|
||||
|
||||
import java.util.Arrays;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Segment.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u000b\b\u0000\u0018\u0000 \u00192\u00020\u0001:\u0001\u0019B\u0007\b\u0016¢\u0006\u0002\u0010\u0002B/\b\u0016\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00020\u0006\u0012\u0006\u0010\b\u001a\u00020\t\u0012\u0006\u0010\n\u001a\u00020\t¢\u0006\u0002\u0010\u000bJ\u0006\u0010\u000e\u001a\u00020\u000fJ\b\u0010\u0010\u001a\u0004\u0018\u00010\u0000J\u000e\u0010\u0011\u001a\u00020\u00002\u0006\u0010\u0012\u001a\u00020\u0000J\u0006\u0010\u0013\u001a\u00020\u0000J\u000e\u0010\u0014\u001a\u00020\u00002\u0006\u0010\u0015\u001a\u00020\u0006J\u0006\u0010\u0016\u001a\u00020\u0000J\u0016\u0010\u0017\u001a\u00020\u000f2\u0006\u0010\u0018\u001a\u00020\u00002\u0006\u0010\u0015\u001a\u00020\u0006R\u0010\u0010\u0003\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\u0007\u001a\u00020\u00068\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\f\u001a\u0004\u0018\u00010\u00008\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000R\u0012\u0010\n\u001a\u00020\t8\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000R\u0012\u0010\u0005\u001a\u00020\u00068\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\r\u001a\u0004\u0018\u00010\u00008\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000R\u0012\u0010\b\u001a\u00020\t8\u0006@\u0006X\u0087\u000e¢\u0006\u0002\n\u0000¨\u0006\u001a"}, m238d2 = {"Lokio/Segment;", "", "()V", "data", "", "pos", "", "limit", "shared", "", "owner", "([BIIZZ)V", "next", "prev", "compact", "", "pop", "push", "segment", "sharedCopy", "split", "byteCount", "unsharedCopy", "writeTo", "sink", "Companion", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Segment {
|
||||
public static final int SHARE_MINIMUM = 1024;
|
||||
public static final int SIZE = 8192;
|
||||
public final byte[] data;
|
||||
public int limit;
|
||||
public Segment next;
|
||||
public boolean owner;
|
||||
public int pos;
|
||||
public Segment prev;
|
||||
public boolean shared;
|
||||
|
||||
public Segment() {
|
||||
this.data = new byte[8192];
|
||||
this.owner = true;
|
||||
this.shared = false;
|
||||
}
|
||||
|
||||
public Segment(byte[] data, int pos, int limit, boolean shared, boolean owner) {
|
||||
Intrinsics.checkNotNullParameter(data, "data");
|
||||
this.data = data;
|
||||
this.pos = pos;
|
||||
this.limit = limit;
|
||||
this.shared = shared;
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public final Segment sharedCopy() {
|
||||
this.shared = true;
|
||||
return new Segment(this.data, this.pos, this.limit, true, false);
|
||||
}
|
||||
|
||||
public final Segment unsharedCopy() {
|
||||
byte[] bArr = this.data;
|
||||
byte[] copyOf = Arrays.copyOf(bArr, bArr.length);
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
|
||||
return new Segment(copyOf, this.pos, this.limit, false, true);
|
||||
}
|
||||
|
||||
public final Segment pop() {
|
||||
Segment result = this.next;
|
||||
if (result == this) {
|
||||
result = null;
|
||||
}
|
||||
Segment segment = this.prev;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
segment.next = this.next;
|
||||
Segment segment2 = this.next;
|
||||
Intrinsics.checkNotNull(segment2);
|
||||
segment2.prev = this.prev;
|
||||
this.next = null;
|
||||
this.prev = null;
|
||||
return result;
|
||||
}
|
||||
|
||||
public final Segment push(Segment segment) {
|
||||
Intrinsics.checkNotNullParameter(segment, "segment");
|
||||
segment.prev = this;
|
||||
segment.next = this.next;
|
||||
Segment segment2 = this.next;
|
||||
Intrinsics.checkNotNull(segment2);
|
||||
segment2.prev = segment;
|
||||
this.next = segment;
|
||||
return segment;
|
||||
}
|
||||
|
||||
public final Segment split(int byteCount) {
|
||||
Segment prefix;
|
||||
if (!(byteCount > 0 && byteCount <= this.limit - this.pos)) {
|
||||
throw new IllegalArgumentException("byteCount out of range".toString());
|
||||
}
|
||||
if (byteCount >= 1024) {
|
||||
prefix = sharedCopy();
|
||||
} else {
|
||||
prefix = SegmentPool.take();
|
||||
byte[] bArr = this.data;
|
||||
byte[] bArr2 = prefix.data;
|
||||
int i = this.pos;
|
||||
ArraysKt.copyInto$default(bArr, bArr2, 0, i, i + byteCount, 2, (Object) null);
|
||||
}
|
||||
prefix.limit = prefix.pos + byteCount;
|
||||
this.pos += byteCount;
|
||||
Segment segment = this.prev;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
segment.push(prefix);
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public final void compact() {
|
||||
Segment segment = this.prev;
|
||||
int i = 0;
|
||||
if (!(segment != this)) {
|
||||
throw new IllegalStateException("cannot compact".toString());
|
||||
}
|
||||
Intrinsics.checkNotNull(segment);
|
||||
if (segment.owner) {
|
||||
int byteCount = this.limit - this.pos;
|
||||
Segment segment2 = this.prev;
|
||||
Intrinsics.checkNotNull(segment2);
|
||||
int i2 = 8192 - segment2.limit;
|
||||
Segment segment3 = this.prev;
|
||||
Intrinsics.checkNotNull(segment3);
|
||||
if (!segment3.shared) {
|
||||
Segment segment4 = this.prev;
|
||||
Intrinsics.checkNotNull(segment4);
|
||||
i = segment4.pos;
|
||||
}
|
||||
int availableByteCount = i2 + i;
|
||||
if (byteCount > availableByteCount) {
|
||||
return;
|
||||
}
|
||||
Segment segment5 = this.prev;
|
||||
Intrinsics.checkNotNull(segment5);
|
||||
writeTo(segment5, byteCount);
|
||||
pop();
|
||||
SegmentPool.recycle(this);
|
||||
}
|
||||
}
|
||||
|
||||
public final void writeTo(Segment sink, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
if (!sink.owner) {
|
||||
throw new IllegalStateException("only owner can write".toString());
|
||||
}
|
||||
int i = sink.limit;
|
||||
if (i + byteCount > 8192) {
|
||||
if (sink.shared) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
int i2 = sink.pos;
|
||||
if ((i + byteCount) - i2 > 8192) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
byte[] bArr = sink.data;
|
||||
ArraysKt.copyInto$default(bArr, bArr, 0, i2, i, 2, (Object) null);
|
||||
sink.limit -= sink.pos;
|
||||
sink.pos = 0;
|
||||
}
|
||||
byte[] bArr2 = this.data;
|
||||
byte[] bArr3 = sink.data;
|
||||
int i3 = sink.limit;
|
||||
int i4 = this.pos;
|
||||
ArraysKt.copyInto(bArr2, bArr3, i3, i4, i4 + byteCount);
|
||||
sink.limit += byteCount;
|
||||
this.pos += byteCount;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package okio;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.JvmStatic;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: SegmentPool.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000.\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0003\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0010\u0010\u0010\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u000eH\u0002J\u0010\u0010\u0011\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u0006H\u0007J\b\u0010\u0014\u001a\u00020\u0006H\u0007R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0007\u001a\u00020\u0004X\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u0011\u0010\n\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u000b\u0010\tR\u001e\u0010\f\u001a\u0010\u0012\f\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u00060\u000e0\rX\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u000f¨\u0006\u0015"}, m238d2 = {"Lokio/SegmentPool;", "", "()V", "HASH_BUCKET_COUNT", "", "LOCK", "Lokio/Segment;", "MAX_SIZE", "getMAX_SIZE", "()I", "byteCount", "getByteCount", "hashBuckets", "", "Ljava/util/concurrent/atomic/AtomicReference;", "[Ljava/util/concurrent/atomic/AtomicReference;", "firstRef", "recycle", "", "segment", "take", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class SegmentPool {
|
||||
private static final int HASH_BUCKET_COUNT;
|
||||
private static final AtomicReference<Segment>[] hashBuckets;
|
||||
public static final SegmentPool INSTANCE = new SegmentPool();
|
||||
private static final int MAX_SIZE = 65536;
|
||||
private static final Segment LOCK = new Segment(new byte[0], 0, 0, false, false);
|
||||
|
||||
static {
|
||||
int highestOneBit = Integer.highestOneBit((Runtime.getRuntime().availableProcessors() * 2) - 1);
|
||||
HASH_BUCKET_COUNT = highestOneBit;
|
||||
AtomicReference<Segment>[] atomicReferenceArr = new AtomicReference[highestOneBit];
|
||||
for (int i = 0; i < highestOneBit; i++) {
|
||||
atomicReferenceArr[i] = new AtomicReference<>();
|
||||
}
|
||||
hashBuckets = atomicReferenceArr;
|
||||
}
|
||||
|
||||
private SegmentPool() {
|
||||
}
|
||||
|
||||
public final int getMAX_SIZE() {
|
||||
return MAX_SIZE;
|
||||
}
|
||||
|
||||
public final int getByteCount() {
|
||||
Segment first = firstRef().get();
|
||||
if (first == null) {
|
||||
return 0;
|
||||
}
|
||||
return first.limit;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final Segment take() {
|
||||
AtomicReference firstRef = INSTANCE.firstRef();
|
||||
Segment segment = LOCK;
|
||||
Segment first = firstRef.getAndSet(segment);
|
||||
if (first == segment) {
|
||||
return new Segment();
|
||||
}
|
||||
if (first == null) {
|
||||
firstRef.set(null);
|
||||
return new Segment();
|
||||
}
|
||||
firstRef.set(first.next);
|
||||
first.next = null;
|
||||
first.limit = 0;
|
||||
return first;
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
public static final void recycle(Segment segment) {
|
||||
AtomicReference firstRef;
|
||||
Segment first;
|
||||
Intrinsics.checkNotNullParameter(segment, "segment");
|
||||
if (!(segment.next == null && segment.prev == null)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
if (segment.shared || (first = (firstRef = INSTANCE.firstRef()).get()) == LOCK) {
|
||||
return;
|
||||
}
|
||||
int firstLimit = first != null ? first.limit : 0;
|
||||
if (firstLimit >= MAX_SIZE) {
|
||||
return;
|
||||
}
|
||||
segment.next = first;
|
||||
segment.pos = 0;
|
||||
segment.limit = firstLimit + 8192;
|
||||
if (!firstRef.compareAndSet(first, segment)) {
|
||||
segment.next = null;
|
||||
}
|
||||
}
|
||||
|
||||
private final AtomicReference<Segment> firstRef() {
|
||||
Thread currentThread = Thread.currentThread();
|
||||
Intrinsics.checkNotNullExpressionValue(currentThread, "Thread.currentThread()");
|
||||
int hashBucket = (int) (currentThread.getId() & (HASH_BUCKET_COUNT - 1));
|
||||
return hashBuckets[hashBucket];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,372 @@
|
||||
package okio;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.MessageDigest;
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import okio.internal.SegmentedByteStringKt;
|
||||
|
||||
/* compiled from: SegmentedByteString.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000h\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\u0015\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u000b\n\u0002\u0010\u0005\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0000\u0018\u00002\u00020\u0001B\u001d\b\u0000\u0012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003\u0012\u0006\u0010\u0005\u001a\u00020\u0006¢\u0006\u0002\u0010\u0007J\b\u0010\r\u001a\u00020\u000eH\u0016J\b\u0010\u000f\u001a\u00020\u0010H\u0016J\b\u0010\u0011\u001a\u00020\u0010H\u0016J\u0015\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u0010H\u0010¢\u0006\u0002\b\u0014J\u0013\u0010\u0015\u001a\u00020\u00162\b\u0010\u0017\u001a\u0004\u0018\u00010\u0018H\u0096\u0002J\r\u0010\u0019\u001a\u00020\u001aH\u0010¢\u0006\u0002\b\u001bJ\b\u0010\u001c\u001a\u00020\u001aH\u0016J\b\u0010\u001d\u001a\u00020\u0010H\u0016J\u001d\u0010\u001e\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u00102\u0006\u0010\u001f\u001a\u00020\u0001H\u0010¢\u0006\u0002\b J\u0018\u0010!\u001a\u00020\u001a2\u0006\u0010\u0017\u001a\u00020\u00042\u0006\u0010\"\u001a\u00020\u001aH\u0016J\r\u0010#\u001a\u00020\u0004H\u0010¢\u0006\u0002\b$J\u0015\u0010%\u001a\u00020&2\u0006\u0010'\u001a\u00020\u001aH\u0010¢\u0006\u0002\b(J\u0018\u0010)\u001a\u00020\u001a2\u0006\u0010\u0017\u001a\u00020\u00042\u0006\u0010\"\u001a\u00020\u001aH\u0016J(\u0010*\u001a\u00020\u00162\u0006\u0010+\u001a\u00020\u001a2\u0006\u0010\u0017\u001a\u00020\u00042\u0006\u0010,\u001a\u00020\u001a2\u0006\u0010-\u001a\u00020\u001aH\u0016J(\u0010*\u001a\u00020\u00162\u0006\u0010+\u001a\u00020\u001a2\u0006\u0010\u0017\u001a\u00020\u00012\u0006\u0010,\u001a\u00020\u001a2\u0006\u0010-\u001a\u00020\u001aH\u0016J\u0010\u0010.\u001a\u00020\u00102\u0006\u0010/\u001a\u000200H\u0016J\u0018\u00101\u001a\u00020\u00012\u0006\u00102\u001a\u00020\u001a2\u0006\u00103\u001a\u00020\u001aH\u0016J\b\u00104\u001a\u00020\u0001H\u0016J\b\u00105\u001a\u00020\u0001H\u0016J\b\u00106\u001a\u00020\u0004H\u0016J\b\u00107\u001a\u00020\u0001H\u0002J\b\u00108\u001a\u00020\u0010H\u0016J\u0010\u00109\u001a\u00020:2\u0006\u0010;\u001a\u00020<H\u0016J%\u00109\u001a\u00020:2\u0006\u0010=\u001a\u00020>2\u0006\u0010+\u001a\u00020\u001a2\u0006\u0010-\u001a\u00020\u001aH\u0010¢\u0006\u0002\b?J\b\u0010@\u001a\u00020AH\u0002R\u0014\u0010\u0005\u001a\u00020\u0006X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u001c\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003X\u0080\u0004¢\u0006\n\n\u0002\u0010\f\u001a\u0004\b\n\u0010\u000b¨\u0006B"}, m238d2 = {"Lokio/SegmentedByteString;", "Lokio/ByteString;", "segments", "", "", "directory", "", "([[B[I)V", "getDirectory$okio", "()[I", "getSegments$okio", "()[[B", "[[B", "asByteBuffer", "Ljava/nio/ByteBuffer;", "base64", "", "base64Url", "digest", "algorithm", "digest$okio", "equals", "", "other", "", "getSize", "", "getSize$okio", "hashCode", "hex", "hmac", "key", "hmac$okio", "indexOf", "fromIndex", "internalArray", "internalArray$okio", "internalGet", "", "pos", "internalGet$okio", "lastIndexOf", "rangeEquals", TypedValues.Cycle.S_WAVE_OFFSET, "otherOffset", "byteCount", TypedValues.Custom.S_STRING, "charset", "Ljava/nio/charset/Charset;", "substring", "beginIndex", "endIndex", "toAsciiLowercase", "toAsciiUppercase", "toByteArray", "toByteString", "toString", "write", "", "out", "Ljava/io/OutputStream;", "buffer", "Lokio/Buffer;", "write$okio", "writeReplace", "Ljava/lang/Object;", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class SegmentedByteString extends ByteString {
|
||||
private final transient int[] directory;
|
||||
private final transient byte[][] segments;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public SegmentedByteString(byte[][] segments, int[] directory) {
|
||||
super(ByteString.EMPTY.getData());
|
||||
Intrinsics.checkNotNullParameter(segments, "segments");
|
||||
Intrinsics.checkNotNullParameter(directory, "directory");
|
||||
this.segments = segments;
|
||||
this.directory = directory;
|
||||
}
|
||||
|
||||
/* renamed from: getSegments$okio, reason: from getter */
|
||||
public final byte[][] getSegments() {
|
||||
return this.segments;
|
||||
}
|
||||
|
||||
/* renamed from: getDirectory$okio, reason: from getter */
|
||||
public final int[] getDirectory() {
|
||||
return this.directory;
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public String string(Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return toByteString().string(charset);
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public String base64() {
|
||||
return toByteString().base64();
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public String hex() {
|
||||
return toByteString().hex();
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public ByteString toAsciiLowercase() {
|
||||
return toByteString().toAsciiLowercase();
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public ByteString toAsciiUppercase() {
|
||||
return toByteString().toAsciiUppercase();
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public ByteString digest$okio(String algorithm) {
|
||||
Intrinsics.checkNotNullParameter(algorithm, "algorithm");
|
||||
MessageDigest digest = MessageDigest.getInstance(algorithm);
|
||||
int segmentCount$iv = getSegments().length;
|
||||
int pos$iv = 0;
|
||||
for (int s$iv = 0; s$iv < segmentCount$iv; s$iv++) {
|
||||
int segmentPos$iv = getDirectory()[segmentCount$iv + s$iv];
|
||||
int nextSegmentOffset$iv = getDirectory()[s$iv];
|
||||
byte[] data = getSegments()[s$iv];
|
||||
int byteCount = nextSegmentOffset$iv - pos$iv;
|
||||
digest.update(data, segmentPos$iv, byteCount);
|
||||
pos$iv = nextSegmentOffset$iv;
|
||||
}
|
||||
byte[] digest2 = digest.digest();
|
||||
Intrinsics.checkNotNullExpressionValue(digest2, "digest.digest()");
|
||||
return new ByteString(digest2);
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public ByteString hmac$okio(String algorithm, ByteString key) {
|
||||
Intrinsics.checkNotNullParameter(algorithm, "algorithm");
|
||||
Intrinsics.checkNotNullParameter(key, "key");
|
||||
try {
|
||||
Mac mac = Mac.getInstance(algorithm);
|
||||
mac.init(new SecretKeySpec(key.toByteArray(), algorithm));
|
||||
int segmentCount$iv = getSegments().length;
|
||||
int pos$iv = 0;
|
||||
for (int s$iv = 0; s$iv < segmentCount$iv; s$iv++) {
|
||||
int segmentPos$iv = getDirectory()[segmentCount$iv + s$iv];
|
||||
int nextSegmentOffset$iv = getDirectory()[s$iv];
|
||||
byte[] data = getSegments()[s$iv];
|
||||
int byteCount = nextSegmentOffset$iv - pos$iv;
|
||||
mac.update(data, segmentPos$iv, byteCount);
|
||||
pos$iv = nextSegmentOffset$iv;
|
||||
}
|
||||
byte[] doFinal = mac.doFinal();
|
||||
Intrinsics.checkNotNullExpressionValue(doFinal, "mac.doFinal()");
|
||||
return new ByteString(doFinal);
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public String base64Url() {
|
||||
return toByteString().base64Url();
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public ByteString substring(int beginIndex, int endIndex) {
|
||||
int segmentOffset$iv = 0;
|
||||
if (!(beginIndex >= 0)) {
|
||||
throw new IllegalArgumentException(("beginIndex=" + beginIndex + " < 0").toString());
|
||||
}
|
||||
if (!(endIndex <= size())) {
|
||||
throw new IllegalArgumentException(("endIndex=" + endIndex + " > length(" + size() + ')').toString());
|
||||
}
|
||||
int subLen$iv = endIndex - beginIndex;
|
||||
if (!(subLen$iv >= 0)) {
|
||||
throw new IllegalArgumentException(("endIndex=" + endIndex + " < beginIndex=" + beginIndex).toString());
|
||||
}
|
||||
if (beginIndex == 0 && endIndex == size()) {
|
||||
return this;
|
||||
}
|
||||
if (beginIndex == endIndex) {
|
||||
return ByteString.EMPTY;
|
||||
}
|
||||
int beginSegment$iv = SegmentedByteStringKt.segment(this, beginIndex);
|
||||
int endSegment$iv = SegmentedByteStringKt.segment(this, endIndex - 1);
|
||||
byte[][] newSegments$iv = (byte[][]) ArraysKt.copyOfRange(getSegments(), beginSegment$iv, endSegment$iv + 1);
|
||||
int[] newDirectory$iv = new int[newSegments$iv.length * 2];
|
||||
int index$iv = 0;
|
||||
if (beginSegment$iv <= endSegment$iv) {
|
||||
int s$iv = beginSegment$iv;
|
||||
while (true) {
|
||||
newDirectory$iv[index$iv] = Math.min(getDirectory()[s$iv] - beginIndex, subLen$iv);
|
||||
int index$iv2 = index$iv + 1;
|
||||
newDirectory$iv[index$iv + newSegments$iv.length] = getDirectory()[getSegments().length + s$iv];
|
||||
if (s$iv == endSegment$iv) {
|
||||
break;
|
||||
}
|
||||
s$iv++;
|
||||
index$iv = index$iv2;
|
||||
}
|
||||
}
|
||||
if (beginSegment$iv != 0) {
|
||||
segmentOffset$iv = getDirectory()[beginSegment$iv - 1];
|
||||
}
|
||||
int length = newSegments$iv.length;
|
||||
newDirectory$iv[length] = newDirectory$iv[length] + (beginIndex - segmentOffset$iv);
|
||||
return new SegmentedByteString(newSegments$iv, newDirectory$iv);
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public byte internalGet$okio(int pos) {
|
||||
Util.checkOffsetAndCount(getDirectory()[getSegments().length - 1], pos, 1L);
|
||||
int segment$iv = SegmentedByteStringKt.segment(this, pos);
|
||||
int segmentOffset$iv = segment$iv == 0 ? 0 : getDirectory()[segment$iv - 1];
|
||||
int segmentPos$iv = getDirectory()[getSegments().length + segment$iv];
|
||||
return getSegments()[segment$iv][(pos - segmentOffset$iv) + segmentPos$iv];
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public int getSize$okio() {
|
||||
return getDirectory()[getSegments().length - 1];
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public byte[] toByteArray() {
|
||||
byte[] result$iv = new byte[size()];
|
||||
int resultPos$iv = 0;
|
||||
int segmentCount$iv$iv = getSegments().length;
|
||||
int pos$iv$iv = 0;
|
||||
for (int s$iv$iv = 0; s$iv$iv < segmentCount$iv$iv; s$iv$iv++) {
|
||||
int segmentPos$iv$iv = getDirectory()[segmentCount$iv$iv + s$iv$iv];
|
||||
int nextSegmentOffset$iv$iv = getDirectory()[s$iv$iv];
|
||||
byte[] data$iv = getSegments()[s$iv$iv];
|
||||
int byteCount$iv = nextSegmentOffset$iv$iv - pos$iv$iv;
|
||||
ArraysKt.copyInto(data$iv, result$iv, resultPos$iv, segmentPos$iv$iv, segmentPos$iv$iv + byteCount$iv);
|
||||
resultPos$iv += byteCount$iv;
|
||||
pos$iv$iv = nextSegmentOffset$iv$iv;
|
||||
}
|
||||
return result$iv;
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public ByteBuffer asByteBuffer() {
|
||||
ByteBuffer asReadOnlyBuffer = ByteBuffer.wrap(toByteArray()).asReadOnlyBuffer();
|
||||
Intrinsics.checkNotNullExpressionValue(asReadOnlyBuffer, "ByteBuffer.wrap(toByteArray()).asReadOnlyBuffer()");
|
||||
return asReadOnlyBuffer;
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public void write(OutputStream out) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(out, "out");
|
||||
int segmentCount$iv = getSegments().length;
|
||||
int pos$iv = 0;
|
||||
for (int s$iv = 0; s$iv < segmentCount$iv; s$iv++) {
|
||||
int segmentPos$iv = getDirectory()[segmentCount$iv + s$iv];
|
||||
int nextSegmentOffset$iv = getDirectory()[s$iv];
|
||||
byte[] data = getSegments()[s$iv];
|
||||
int byteCount = nextSegmentOffset$iv - pos$iv;
|
||||
out.write(data, segmentPos$iv, byteCount);
|
||||
pos$iv = nextSegmentOffset$iv;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public void write$okio(Buffer buffer, int offset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(buffer, "buffer");
|
||||
int endIndex$iv$iv = offset + byteCount;
|
||||
int s$iv$iv = SegmentedByteStringKt.segment(this, offset);
|
||||
int pos$iv$iv = offset;
|
||||
while (pos$iv$iv < endIndex$iv$iv) {
|
||||
int segmentOffset$iv$iv = s$iv$iv == 0 ? 0 : getDirectory()[s$iv$iv - 1];
|
||||
int segmentSize$iv$iv = getDirectory()[s$iv$iv] - segmentOffset$iv$iv;
|
||||
int segmentPos$iv$iv = getDirectory()[getSegments().length + s$iv$iv];
|
||||
int byteCount$iv$iv = Math.min(endIndex$iv$iv, segmentOffset$iv$iv + segmentSize$iv$iv) - pos$iv$iv;
|
||||
int offset$iv$iv = (pos$iv$iv - segmentOffset$iv$iv) + segmentPos$iv$iv;
|
||||
byte[] data$iv = getSegments()[s$iv$iv];
|
||||
Segment segment$iv = new Segment(data$iv, offset$iv$iv, offset$iv$iv + byteCount$iv$iv, true, false);
|
||||
if (buffer.head == null) {
|
||||
segment$iv.prev = segment$iv;
|
||||
segment$iv.next = segment$iv.prev;
|
||||
buffer.head = segment$iv.next;
|
||||
} else {
|
||||
Segment segment = buffer.head;
|
||||
Intrinsics.checkNotNull(segment);
|
||||
Segment segment2 = segment.prev;
|
||||
Intrinsics.checkNotNull(segment2);
|
||||
segment2.push(segment$iv);
|
||||
}
|
||||
pos$iv$iv += byteCount$iv$iv;
|
||||
s$iv$iv++;
|
||||
}
|
||||
buffer.setSize$okio(buffer.size() + size());
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public boolean rangeEquals(int offset, ByteString other, int otherOffset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
SegmentedByteString $this$commonRangeEquals$iv = this;
|
||||
if (offset >= 0 && offset <= $this$commonRangeEquals$iv.size() - byteCount) {
|
||||
int otherOffset$iv = otherOffset;
|
||||
int endIndex$iv$iv = offset + byteCount;
|
||||
int s$iv$iv = SegmentedByteStringKt.segment($this$commonRangeEquals$iv, offset);
|
||||
int pos$iv$iv = offset;
|
||||
while (pos$iv$iv < endIndex$iv$iv) {
|
||||
int segmentOffset$iv$iv = s$iv$iv == 0 ? 0 : $this$commonRangeEquals$iv.getDirectory()[s$iv$iv - 1];
|
||||
int segmentSize$iv$iv = $this$commonRangeEquals$iv.getDirectory()[s$iv$iv] - segmentOffset$iv$iv;
|
||||
int segmentPos$iv$iv = $this$commonRangeEquals$iv.getDirectory()[$this$commonRangeEquals$iv.getSegments().length + s$iv$iv];
|
||||
int byteCount$iv$iv = Math.min(endIndex$iv$iv, segmentOffset$iv$iv + segmentSize$iv$iv) - pos$iv$iv;
|
||||
int offset$iv$iv = (pos$iv$iv - segmentOffset$iv$iv) + segmentPos$iv$iv;
|
||||
byte[] data$iv = $this$commonRangeEquals$iv.getSegments()[s$iv$iv];
|
||||
SegmentedByteString $this$commonRangeEquals$iv2 = $this$commonRangeEquals$iv;
|
||||
if (!other.rangeEquals(otherOffset$iv, data$iv, offset$iv$iv, byteCount$iv$iv)) {
|
||||
return false;
|
||||
}
|
||||
otherOffset$iv += byteCount$iv$iv;
|
||||
pos$iv$iv += byteCount$iv$iv;
|
||||
s$iv$iv++;
|
||||
$this$commonRangeEquals$iv = $this$commonRangeEquals$iv2;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public boolean rangeEquals(int offset, byte[] other, int otherOffset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
if (offset < 0 || offset > size() - byteCount || otherOffset < 0 || otherOffset > other.length - byteCount) {
|
||||
return false;
|
||||
}
|
||||
int otherOffset$iv = otherOffset;
|
||||
int endIndex$iv$iv = offset + byteCount;
|
||||
int s$iv$iv = SegmentedByteStringKt.segment(this, offset);
|
||||
int pos$iv$iv = offset;
|
||||
while (pos$iv$iv < endIndex$iv$iv) {
|
||||
int segmentOffset$iv$iv = s$iv$iv == 0 ? 0 : getDirectory()[s$iv$iv - 1];
|
||||
int segmentSize$iv$iv = getDirectory()[s$iv$iv] - segmentOffset$iv$iv;
|
||||
int segmentPos$iv$iv = getDirectory()[getSegments().length + s$iv$iv];
|
||||
int byteCount$iv$iv = Math.min(endIndex$iv$iv, segmentOffset$iv$iv + segmentSize$iv$iv) - pos$iv$iv;
|
||||
int offset$iv$iv = segmentPos$iv$iv + (pos$iv$iv - segmentOffset$iv$iv);
|
||||
byte[] data$iv = getSegments()[s$iv$iv];
|
||||
if (!Util.arrayRangeEquals(data$iv, offset$iv$iv, other, otherOffset$iv, byteCount$iv$iv)) {
|
||||
return false;
|
||||
}
|
||||
otherOffset$iv += byteCount$iv$iv;
|
||||
pos$iv$iv += byteCount$iv$iv;
|
||||
s$iv$iv++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public int indexOf(byte[] other, int fromIndex) {
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
return toByteString().indexOf(other, fromIndex);
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public int lastIndexOf(byte[] other, int fromIndex) {
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
return toByteString().lastIndexOf(other, fromIndex);
|
||||
}
|
||||
|
||||
private final ByteString toByteString() {
|
||||
return new ByteString(toByteArray());
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public byte[] internalArray$okio() {
|
||||
return toByteArray();
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) {
|
||||
return true;
|
||||
}
|
||||
if (other instanceof ByteString) {
|
||||
return ((ByteString) other).size() == size() && rangeEquals(0, (ByteString) other, 0, size());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public int hashCode() {
|
||||
int result$iv = getHashCode();
|
||||
if (result$iv == 0) {
|
||||
result$iv = 1;
|
||||
int segmentCount$iv$iv = getSegments().length;
|
||||
int pos$iv$iv = 0;
|
||||
for (int s$iv$iv = 0; s$iv$iv < segmentCount$iv$iv; s$iv$iv++) {
|
||||
int segmentPos$iv$iv = getDirectory()[segmentCount$iv$iv + s$iv$iv];
|
||||
int nextSegmentOffset$iv$iv = getDirectory()[s$iv$iv];
|
||||
byte[] data$iv = getSegments()[s$iv$iv];
|
||||
int byteCount$iv = nextSegmentOffset$iv$iv - pos$iv$iv;
|
||||
int limit$iv = segmentPos$iv$iv + byteCount$iv;
|
||||
for (int i$iv = segmentPos$iv$iv; i$iv < limit$iv; i$iv++) {
|
||||
result$iv = (result$iv * 31) + data$iv[i$iv];
|
||||
}
|
||||
pos$iv$iv = nextSegmentOffset$iv$iv;
|
||||
}
|
||||
setHashCode$okio(result$iv);
|
||||
}
|
||||
return result$iv;
|
||||
}
|
||||
|
||||
@Override // okio.ByteString
|
||||
public String toString() {
|
||||
return toByteString().toString();
|
||||
}
|
||||
|
||||
private final Object writeReplace() {
|
||||
ByteString byteString = toByteString();
|
||||
if (byteString != null) {
|
||||
return byteString;
|
||||
}
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.Object");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package okio;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.Flushable;
|
||||
import java.io.IOException;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Sink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\bf\u0018\u00002\u00020\u00012\u00020\u0002J\b\u0010\u0003\u001a\u00020\u0004H&J\b\u0010\u0005\u001a\u00020\u0004H&J\b\u0010\u0006\u001a\u00020\u0007H&J\u0018\u0010\b\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH&¨\u0006\r"}, m238d2 = {"Lokio/Sink;", "Ljava/io/Closeable;", "Ljava/io/Flushable;", "close", "", "flush", "timeout", "Lokio/Timeout;", "write", "source", "Lokio/Buffer;", "byteCount", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public interface Sink extends Closeable, Flushable {
|
||||
@Override // java.io.Closeable, java.lang.AutoCloseable
|
||||
void close() throws IOException;
|
||||
|
||||
void flush() throws IOException;
|
||||
|
||||
Timeout timeout();
|
||||
|
||||
void write(Buffer source, long byteCount) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: JvmOkio.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000 \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\u0002\n\u0002\u0010\u0002\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0012\u0010\u0005\u001a\u00020\u00062\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006H\u0014J\b\u0010\b\u001a\u00020\tH\u0014R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, m238d2 = {"Lokio/SocketAsyncTimeout;", "Lokio/AsyncTimeout;", "socket", "Ljava/net/Socket;", "(Ljava/net/Socket;)V", "newTimeoutException", "Ljava/io/IOException;", "cause", "timedOut", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
final class SocketAsyncTimeout extends AsyncTimeout {
|
||||
private final Socket socket;
|
||||
|
||||
public SocketAsyncTimeout(Socket socket) {
|
||||
Intrinsics.checkNotNullParameter(socket, "socket");
|
||||
this.socket = socket;
|
||||
}
|
||||
|
||||
@Override // okio.AsyncTimeout
|
||||
protected IOException newTimeoutException(IOException cause) {
|
||||
SocketTimeoutException ioe = new SocketTimeoutException("timeout");
|
||||
if (cause != null) {
|
||||
ioe.initCause(cause);
|
||||
}
|
||||
return ioe;
|
||||
}
|
||||
|
||||
@Override // okio.AsyncTimeout
|
||||
protected void timedOut() {
|
||||
Logger logger;
|
||||
Logger logger2;
|
||||
try {
|
||||
this.socket.close();
|
||||
} catch (AssertionError e) {
|
||||
if (Okio.isAndroidGetsocknameError(e)) {
|
||||
logger2 = Okio__JvmOkioKt.logger;
|
||||
logger2.log(Level.WARNING, "Failed to close timed out socket " + this.socket, (Throwable) e);
|
||||
return;
|
||||
}
|
||||
throw e;
|
||||
} catch (Exception e2) {
|
||||
logger = Okio__JvmOkioKt.logger;
|
||||
logger.log(Level.WARNING, "Failed to close timed out socket " + this.socket, (Throwable) e2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package okio;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Source.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\bf\u0018\u00002\u00020\u0001J\b\u0010\u0002\u001a\u00020\u0003H&J\u0018\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u0005H&J\b\u0010\t\u001a\u00020\nH&¨\u0006\u000b"}, m238d2 = {"Lokio/Source;", "Ljava/io/Closeable;", "close", "", "read", "", "sink", "Lokio/Buffer;", "byteCount", "timeout", "Lokio/Timeout;", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public interface Source extends Closeable {
|
||||
@Override // java.io.Closeable, java.lang.AutoCloseable
|
||||
void close() throws IOException;
|
||||
|
||||
long read(Buffer sink, long byteCount) throws IOException;
|
||||
|
||||
Timeout timeout();
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
package okio;
|
||||
|
||||
import android.support.v4.media.session.PlaybackStateCompat;
|
||||
import java.io.IOException;
|
||||
import java.io.InterruptedIOException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Throttler.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\b\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0007\u0018\u00002\u00020\u0001B\u0007\b\u0016¢\u0006\u0002\u0010\u0002B\u000f\b\u0000\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u001d\u0010\t\u001a\u00020\u00042\u0006\u0010\n\u001a\u00020\u00042\u0006\u0010\u000b\u001a\u00020\u0004H\u0000¢\u0006\u0002\b\fJ$\u0010\u0006\u001a\u00020\r2\u0006\u0010\u0006\u001a\u00020\u00042\b\b\u0002\u0010\b\u001a\u00020\u00042\b\b\u0002\u0010\u0007\u001a\u00020\u0004H\u0007J\u000e\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u000e\u001a\u00020\u000fJ\u000e\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0010\u001a\u00020\u0011J\u0015\u0010\u0012\u001a\u00020\u00042\u0006\u0010\u000b\u001a\u00020\u0004H\u0000¢\u0006\u0002\b\u0013J\u0010\u0010\u0014\u001a\u00020\r2\u0006\u0010\u0015\u001a\u00020\u0004H\u0002J\f\u0010\u0016\u001a\u00020\u0004*\u00020\u0004H\u0002J\f\u0010\u0017\u001a\u00020\u0004*\u00020\u0004H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u0018"}, m238d2 = {"Lokio/Throttler;", "", "()V", "allocatedUntil", "", "(J)V", "bytesPerSecond", "maxByteCount", "waitByteCount", "byteCountOrWaitNanos", "now", "byteCount", "byteCountOrWaitNanos$okio", "", "sink", "Lokio/Sink;", "source", "Lokio/Source;", "take", "take$okio", "waitNanos", "nanosToWait", "bytesToNanos", "nanosToBytes", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Throttler {
|
||||
private long allocatedUntil;
|
||||
private long bytesPerSecond;
|
||||
private long maxByteCount;
|
||||
private long waitByteCount;
|
||||
|
||||
public final void bytesPerSecond(long j) {
|
||||
bytesPerSecond$default(this, j, 0L, 0L, 6, null);
|
||||
}
|
||||
|
||||
public final void bytesPerSecond(long j, long j2) {
|
||||
bytesPerSecond$default(this, j, j2, 0L, 4, null);
|
||||
}
|
||||
|
||||
public Throttler(long allocatedUntil) {
|
||||
this.allocatedUntil = allocatedUntil;
|
||||
this.waitByteCount = PlaybackStateCompat.ACTION_PLAY_FROM_URI;
|
||||
this.maxByteCount = PlaybackStateCompat.ACTION_SET_REPEAT_MODE;
|
||||
}
|
||||
|
||||
public Throttler() {
|
||||
this(System.nanoTime());
|
||||
}
|
||||
|
||||
public static /* synthetic */ void bytesPerSecond$default(Throttler throttler, long j, long j2, long j3, int i, Object obj) {
|
||||
throttler.bytesPerSecond(j, (i & 2) != 0 ? throttler.waitByteCount : j2, (i & 4) != 0 ? throttler.maxByteCount : j3);
|
||||
}
|
||||
|
||||
public final void bytesPerSecond(long bytesPerSecond, long waitByteCount, long maxByteCount) {
|
||||
synchronized (this) {
|
||||
if (!(bytesPerSecond >= 0)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
if (!(waitByteCount > 0)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
if (!(maxByteCount >= waitByteCount)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
this.bytesPerSecond = bytesPerSecond;
|
||||
this.waitByteCount = waitByteCount;
|
||||
this.maxByteCount = maxByteCount;
|
||||
notifyAll();
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
public final long take$okio(long byteCount) {
|
||||
long byteCountOrWaitNanos;
|
||||
if (!(byteCount > 0)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
synchronized (this) {
|
||||
while (true) {
|
||||
long now = System.nanoTime();
|
||||
byteCountOrWaitNanos = byteCountOrWaitNanos$okio(now, byteCount);
|
||||
if (byteCountOrWaitNanos < 0) {
|
||||
waitNanos(-byteCountOrWaitNanos);
|
||||
}
|
||||
}
|
||||
}
|
||||
return byteCountOrWaitNanos;
|
||||
}
|
||||
|
||||
public final long byteCountOrWaitNanos$okio(long now, long byteCount) {
|
||||
if (this.bytesPerSecond == 0) {
|
||||
return byteCount;
|
||||
}
|
||||
long idleInNanos = Math.max(this.allocatedUntil - now, 0L);
|
||||
long immediateBytes = this.maxByteCount - nanosToBytes(idleInNanos);
|
||||
if (immediateBytes >= byteCount) {
|
||||
this.allocatedUntil = now + idleInNanos + bytesToNanos(byteCount);
|
||||
return byteCount;
|
||||
}
|
||||
long j = this.waitByteCount;
|
||||
if (immediateBytes >= j) {
|
||||
this.allocatedUntil = bytesToNanos(this.maxByteCount) + now;
|
||||
return immediateBytes;
|
||||
}
|
||||
long minByteCount = Math.min(j, byteCount);
|
||||
long minWaitNanos = bytesToNanos(minByteCount - this.maxByteCount) + idleInNanos;
|
||||
if (minWaitNanos == 0) {
|
||||
this.allocatedUntil = bytesToNanos(this.maxByteCount) + now;
|
||||
return minByteCount;
|
||||
}
|
||||
return -minWaitNanos;
|
||||
}
|
||||
|
||||
private final long nanosToBytes(long $this$nanosToBytes) {
|
||||
return (this.bytesPerSecond * $this$nanosToBytes) / 1000000000;
|
||||
}
|
||||
|
||||
private final long bytesToNanos(long $this$bytesToNanos) {
|
||||
return (1000000000 * $this$bytesToNanos) / this.bytesPerSecond;
|
||||
}
|
||||
|
||||
private final void waitNanos(long nanosToWait) {
|
||||
long millisToWait = nanosToWait / 1000000;
|
||||
long remainderNanos = nanosToWait - (1000000 * millisToWait);
|
||||
wait(millisToWait, (int) remainderNanos);
|
||||
}
|
||||
|
||||
public final Source source(final Source source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new ForwardingSource(source) { // from class: okio.Throttler$source$1
|
||||
@Override // okio.ForwardingSource, okio.Source
|
||||
public long read(Buffer sink, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
try {
|
||||
long toRead = Throttler.this.take$okio(byteCount);
|
||||
return super.read(sink, toRead);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new InterruptedIOException("interrupted");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public final Sink sink(final Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
return new ForwardingSink(sink) { // from class: okio.Throttler$sink$1
|
||||
@Override // okio.ForwardingSink, okio.Sink
|
||||
public void write(Buffer source, long byteCount) throws IOException {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
long remaining = byteCount;
|
||||
while (remaining > 0) {
|
||||
try {
|
||||
long toWrite = Throttler.this.take$okio(remaining);
|
||||
super.write(source, toWrite);
|
||||
remaining -= toWrite;
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new InterruptedIOException("interrupted");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package okio;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.IOException;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Timeout.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0016\u0018\u0000 \u00172\u00020\u0001:\u0001\u0017B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\b\u001a\u00020\u0000H\u0016J\b\u0010\t\u001a\u00020\u0000H\u0016J\u0016\u0010\n\u001a\u00020\u00002\u0006\u0010\u000b\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\rJ\b\u0010\u0003\u001a\u00020\u0004H\u0016J\u0010\u0010\u0003\u001a\u00020\u00002\u0006\u0010\u0003\u001a\u00020\u0004H\u0016J\b\u0010\u0005\u001a\u00020\u0006H\u0016J\"\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00002\f\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u000f0\u0012H\u0086\bø\u0001\u0000J\b\u0010\u0013\u001a\u00020\u000fH\u0016J\u0018\u0010\u0014\u001a\u00020\u00002\u0006\u0010\u0014\u001a\u00020\u00042\u0006\u0010\f\u001a\u00020\rH\u0016J\b\u0010\u0007\u001a\u00020\u0004H\u0016J\u000e\u0010\u0015\u001a\u00020\u000f2\u0006\u0010\u0016\u001a\u00020\u0001R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u0018"}, m238d2 = {"Lokio/Timeout;", "", "()V", "deadlineNanoTime", "", "hasDeadline", "", "timeoutNanos", "clearDeadline", "clearTimeout", "deadline", TypedValues.Transition.S_DURATION, "unit", "Ljava/util/concurrent/TimeUnit;", "intersectWith", "", "other", "block", "Lkotlin/Function0;", "throwIfReached", "timeout", "waitUntilNotified", "monitor", "Companion", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public class Timeout {
|
||||
|
||||
/* renamed from: Companion, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
public static final Timeout NONE = new Timeout() { // from class: okio.Timeout$Companion$NONE$1
|
||||
@Override // okio.Timeout
|
||||
public Timeout timeout(long timeout, TimeUnit unit) {
|
||||
Intrinsics.checkNotNullParameter(unit, "unit");
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public Timeout deadlineNanoTime(long deadlineNanoTime) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override // okio.Timeout
|
||||
public void throwIfReached() {
|
||||
}
|
||||
};
|
||||
private long deadlineNanoTime;
|
||||
private boolean hasDeadline;
|
||||
private long timeoutNanos;
|
||||
|
||||
public Timeout timeout(long timeout, TimeUnit unit) {
|
||||
Intrinsics.checkNotNullParameter(unit, "unit");
|
||||
if (!(timeout >= 0)) {
|
||||
throw new IllegalArgumentException(("timeout < 0: " + timeout).toString());
|
||||
}
|
||||
this.timeoutNanos = unit.toNanos(timeout);
|
||||
return this;
|
||||
}
|
||||
|
||||
/* renamed from: timeoutNanos, reason: from getter */
|
||||
public long getTimeoutNanos() {
|
||||
return this.timeoutNanos;
|
||||
}
|
||||
|
||||
/* renamed from: hasDeadline, reason: from getter */
|
||||
public boolean getHasDeadline() {
|
||||
return this.hasDeadline;
|
||||
}
|
||||
|
||||
public long deadlineNanoTime() {
|
||||
if (this.hasDeadline) {
|
||||
return this.deadlineNanoTime;
|
||||
}
|
||||
throw new IllegalStateException("No deadline".toString());
|
||||
}
|
||||
|
||||
public Timeout deadlineNanoTime(long deadlineNanoTime) {
|
||||
this.hasDeadline = true;
|
||||
this.deadlineNanoTime = deadlineNanoTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public final Timeout deadline(long duration, TimeUnit unit) {
|
||||
Intrinsics.checkNotNullParameter(unit, "unit");
|
||||
if (!(duration > 0)) {
|
||||
throw new IllegalArgumentException(("duration <= 0: " + duration).toString());
|
||||
}
|
||||
return deadlineNanoTime(System.nanoTime() + unit.toNanos(duration));
|
||||
}
|
||||
|
||||
public Timeout clearTimeout() {
|
||||
this.timeoutNanos = 0L;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Timeout clearDeadline() {
|
||||
this.hasDeadline = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void throwIfReached() throws IOException {
|
||||
if (Thread.interrupted()) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new InterruptedIOException("interrupted");
|
||||
}
|
||||
if (this.hasDeadline && this.deadlineNanoTime - System.nanoTime() <= 0) {
|
||||
throw new InterruptedIOException("deadline reached");
|
||||
}
|
||||
}
|
||||
|
||||
public final void waitUntilNotified(Object monitor) throws InterruptedIOException {
|
||||
long j;
|
||||
Intrinsics.checkNotNullParameter(monitor, "monitor");
|
||||
try {
|
||||
boolean hasDeadline = getHasDeadline();
|
||||
long timeoutNanos = getTimeoutNanos();
|
||||
if (!hasDeadline && timeoutNanos == 0) {
|
||||
monitor.wait();
|
||||
return;
|
||||
}
|
||||
long start = System.nanoTime();
|
||||
if (hasDeadline && timeoutNanos != 0) {
|
||||
long deadlineNanos = deadlineNanoTime() - start;
|
||||
j = Math.min(timeoutNanos, deadlineNanos);
|
||||
} else if (hasDeadline) {
|
||||
j = deadlineNanoTime() - start;
|
||||
} else {
|
||||
j = timeoutNanos;
|
||||
}
|
||||
long waitNanos = j;
|
||||
long elapsedNanos = 0;
|
||||
if (waitNanos > 0) {
|
||||
long waitMillis = waitNanos / 1000000;
|
||||
Long.signum(waitMillis);
|
||||
monitor.wait(waitMillis, (int) (waitNanos - (1000000 * waitMillis)));
|
||||
elapsedNanos = System.nanoTime() - start;
|
||||
}
|
||||
if (elapsedNanos >= waitNanos) {
|
||||
throw new InterruptedIOException("timeout");
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new InterruptedIOException("interrupted");
|
||||
}
|
||||
}
|
||||
|
||||
public final void intersectWith(Timeout other, Function0<Unit> block) {
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
long originalTimeout = getTimeoutNanos();
|
||||
timeout(INSTANCE.minTimeout(other.getTimeoutNanos(), getTimeoutNanos()), TimeUnit.NANOSECONDS);
|
||||
if (getHasDeadline()) {
|
||||
long originalDeadline = deadlineNanoTime();
|
||||
if (other.getHasDeadline()) {
|
||||
deadlineNanoTime(Math.min(deadlineNanoTime(), other.deadlineNanoTime()));
|
||||
}
|
||||
try {
|
||||
block.invoke();
|
||||
return;
|
||||
} finally {
|
||||
InlineMarker.finallyStart(1);
|
||||
timeout(originalTimeout, TimeUnit.NANOSECONDS);
|
||||
if (other.getHasDeadline()) {
|
||||
deadlineNanoTime(originalDeadline);
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
}
|
||||
}
|
||||
if (other.getHasDeadline()) {
|
||||
deadlineNanoTime(other.deadlineNanoTime());
|
||||
}
|
||||
try {
|
||||
block.invoke();
|
||||
} finally {
|
||||
InlineMarker.finallyStart(1);
|
||||
timeout(originalTimeout, TimeUnit.NANOSECONDS);
|
||||
if (other.getHasDeadline()) {
|
||||
clearDeadline();
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: Timeout.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\b\u001a\u00020\u0006R\u0010\u0010\u0003\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\t"}, m238d2 = {"Lokio/Timeout$Companion;", "", "()V", "NONE", "Lokio/Timeout;", "minTimeout", "", "aNanos", "bNanos", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
public static final class Companion {
|
||||
private Companion() {
|
||||
}
|
||||
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
|
||||
this();
|
||||
}
|
||||
|
||||
public final long minTimeout(long aNanos, long bNanos) {
|
||||
return (aNanos != 0 && (bNanos == 0 || aNanos < bNanos)) ? aNanos : bNanos;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,491 @@
|
||||
package okio;
|
||||
|
||||
import com.google.common.base.Ascii;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Utf8.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000D\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0005\n\u0000\n\u0002\u0010\f\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0012\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0002\u001a\u0011\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u0001H\u0080\b\u001a\u0011\u0010\u000e\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\u0007H\u0080\b\u001a4\u0010\u0010\u001a\u00020\u0001*\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u00012\u0012\u0010\u0014\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00160\u0015H\u0080\bø\u0001\u0000\u001a4\u0010\u0017\u001a\u00020\u0001*\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u00012\u0012\u0010\u0014\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00160\u0015H\u0080\bø\u0001\u0000\u001a4\u0010\u0018\u001a\u00020\u0001*\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u00012\u0012\u0010\u0014\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00160\u0015H\u0080\bø\u0001\u0000\u001a4\u0010\u0019\u001a\u00020\u0016*\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u00012\u0012\u0010\u0014\u001a\u000e\u0012\u0004\u0012\u00020\t\u0012\u0004\u0012\u00020\u00160\u0015H\u0080\bø\u0001\u0000\u001a4\u0010\u001a\u001a\u00020\u0016*\u00020\u001b2\u0006\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u00012\u0012\u0010\u0014\u001a\u000e\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u00160\u0015H\u0080\bø\u0001\u0000\u001a4\u0010\u001c\u001a\u00020\u0016*\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00012\u0006\u0010\u0013\u001a\u00020\u00012\u0012\u0010\u0014\u001a\u000e\u0012\u0004\u0012\u00020\u0001\u0012\u0004\u0012\u00020\u00160\u0015H\u0080\bø\u0001\u0000\u001a%\u0010\u001d\u001a\u00020\u001e*\u00020\u001b2\b\b\u0002\u0010\u0012\u001a\u00020\u00012\b\b\u0002\u0010\u0013\u001a\u00020\u0001H\u0007¢\u0006\u0002\b\u001f\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0004\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0005\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0006\u001a\u00020\u0007X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\b\u001a\u00020\tX\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\n\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006 "}, m238d2 = {"HIGH_SURROGATE_HEADER", "", "LOG_SURROGATE_HEADER", "MASK_2BYTES", "MASK_3BYTES", "MASK_4BYTES", "REPLACEMENT_BYTE", "", "REPLACEMENT_CHARACTER", "", "REPLACEMENT_CODE_POINT", "isIsoControl", "", "codePoint", "isUtf8Continuation", "byte", "process2Utf8Bytes", "", "beginIndex", "endIndex", "yield", "Lkotlin/Function1;", "", "process3Utf8Bytes", "process4Utf8Bytes", "processUtf16Chars", "processUtf8Bytes", "", "processUtf8CodePoints", "utf8Size", "", "size", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Utf8 {
|
||||
public static final int HIGH_SURROGATE_HEADER = 55232;
|
||||
public static final int LOG_SURROGATE_HEADER = 56320;
|
||||
public static final int MASK_2BYTES = 3968;
|
||||
public static final int MASK_3BYTES = -123008;
|
||||
public static final int MASK_4BYTES = 3678080;
|
||||
public static final byte REPLACEMENT_BYTE = 63;
|
||||
public static final char REPLACEMENT_CHARACTER = 65533;
|
||||
public static final int REPLACEMENT_CODE_POINT = 65533;
|
||||
|
||||
public static final long size(String str) {
|
||||
return size$default(str, 0, 0, 3, null);
|
||||
}
|
||||
|
||||
public static final long size(String str, int i) {
|
||||
return size$default(str, i, 0, 2, null);
|
||||
}
|
||||
|
||||
public static /* synthetic */ long size$default(String str, int i, int i2, int i3, Object obj) {
|
||||
if ((i3 & 1) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
if ((i3 & 2) != 0) {
|
||||
i2 = str.length();
|
||||
}
|
||||
return size(str, i, i2);
|
||||
}
|
||||
|
||||
public static final long size(String utf8Size, int beginIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(utf8Size, "$this$utf8Size");
|
||||
if (!(beginIndex >= 0)) {
|
||||
throw new IllegalArgumentException(("beginIndex < 0: " + beginIndex).toString());
|
||||
}
|
||||
if (!(endIndex >= beginIndex)) {
|
||||
throw new IllegalArgumentException(("endIndex < beginIndex: " + endIndex + " < " + beginIndex).toString());
|
||||
}
|
||||
if (!(endIndex <= utf8Size.length())) {
|
||||
throw new IllegalArgumentException(("endIndex > string.length: " + endIndex + " > " + utf8Size.length()).toString());
|
||||
}
|
||||
long result = 0;
|
||||
int i = beginIndex;
|
||||
while (i < endIndex) {
|
||||
int c = utf8Size.charAt(i);
|
||||
if (c < 128) {
|
||||
result++;
|
||||
i++;
|
||||
} else if (c < 2048) {
|
||||
result += 2;
|
||||
i++;
|
||||
} else if (c < 55296 || c > 57343) {
|
||||
result += 3;
|
||||
i++;
|
||||
} else {
|
||||
int low = i + 1 < endIndex ? utf8Size.charAt(i + 1) : 0;
|
||||
if (c > 56319 || low < 56320 || low > 57343) {
|
||||
result++;
|
||||
i++;
|
||||
} else {
|
||||
result += 4;
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final boolean isIsoControl(int codePoint) {
|
||||
return (codePoint >= 0 && 31 >= codePoint) || (127 <= codePoint && 159 >= codePoint);
|
||||
}
|
||||
|
||||
public static final boolean isUtf8Continuation(byte b) {
|
||||
int other$iv = 192 & b;
|
||||
return other$iv == 128;
|
||||
}
|
||||
|
||||
public static final void processUtf8Bytes(String processUtf8Bytes, int beginIndex, int endIndex, Function1<? super Byte, Unit> yield) {
|
||||
char charAt;
|
||||
Intrinsics.checkNotNullParameter(processUtf8Bytes, "$this$processUtf8Bytes");
|
||||
Intrinsics.checkNotNullParameter(yield, "yield");
|
||||
int index = beginIndex;
|
||||
while (index < endIndex) {
|
||||
char c = processUtf8Bytes.charAt(index);
|
||||
if (Intrinsics.compare((int) c, 128) < 0) {
|
||||
yield.invoke(Byte.valueOf((byte) c));
|
||||
index++;
|
||||
while (index < endIndex && Intrinsics.compare((int) processUtf8Bytes.charAt(index), 128) < 0) {
|
||||
yield.invoke(Byte.valueOf((byte) processUtf8Bytes.charAt(index)));
|
||||
index++;
|
||||
}
|
||||
} else if (Intrinsics.compare((int) c, 2048) < 0) {
|
||||
yield.invoke(Byte.valueOf((byte) ((c >> 6) | 192)));
|
||||
yield.invoke(Byte.valueOf((byte) (128 | (c & '?'))));
|
||||
index++;
|
||||
} else if (55296 > c || 57343 < c) {
|
||||
yield.invoke(Byte.valueOf((byte) ((c >> '\f') | 224)));
|
||||
yield.invoke(Byte.valueOf((byte) (((c >> 6) & 63) | 128)));
|
||||
yield.invoke(Byte.valueOf((byte) (128 | (c & '?'))));
|
||||
index++;
|
||||
} else if (Intrinsics.compare((int) c, 56319) > 0 || endIndex <= index + 1 || 56320 > (charAt = processUtf8Bytes.charAt(index + 1)) || 57343 < charAt) {
|
||||
yield.invoke(Byte.valueOf(REPLACEMENT_BYTE));
|
||||
index++;
|
||||
} else {
|
||||
int codePoint = ((c << '\n') + processUtf8Bytes.charAt(index + 1)) - 56613888;
|
||||
yield.invoke(Byte.valueOf((byte) ((codePoint >> 18) | 240)));
|
||||
yield.invoke(Byte.valueOf((byte) (((codePoint >> 12) & 63) | 128)));
|
||||
yield.invoke(Byte.valueOf((byte) ((63 & (codePoint >> 6)) | 128)));
|
||||
yield.invoke(Byte.valueOf((byte) (128 | (codePoint & 63))));
|
||||
index += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final void processUtf8CodePoints(byte[] processUtf8CodePoints, int beginIndex, int endIndex, Function1<? super Integer, Unit> yield) {
|
||||
int i;
|
||||
int i2;
|
||||
byte b1$iv;
|
||||
Intrinsics.checkNotNullParameter(processUtf8CodePoints, "$this$processUtf8CodePoints");
|
||||
Intrinsics.checkNotNullParameter(yield, "yield");
|
||||
int index = beginIndex;
|
||||
while (index < endIndex) {
|
||||
byte b0 = processUtf8CodePoints[index];
|
||||
if (b0 >= 0) {
|
||||
yield.invoke(Integer.valueOf(b0));
|
||||
index++;
|
||||
while (index < endIndex && processUtf8CodePoints[index] >= 0) {
|
||||
yield.invoke(Integer.valueOf(processUtf8CodePoints[index]));
|
||||
index++;
|
||||
}
|
||||
} else {
|
||||
int other$iv = b0 >> 5;
|
||||
if (other$iv == -2) {
|
||||
if (endIndex <= index + 1) {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit = Unit.INSTANCE;
|
||||
i = 1;
|
||||
} else {
|
||||
byte b0$iv = processUtf8CodePoints[index];
|
||||
int b1$iv2 = processUtf8CodePoints[index + 1];
|
||||
int other$iv$iv$iv = b1$iv2 & 192;
|
||||
if (other$iv$iv$iv == 128) {
|
||||
int codePoint$iv = (b1$iv2 ^ MASK_2BYTES) ^ (b0$iv << 6);
|
||||
int it = codePoint$iv < 128 ? REPLACEMENT_CODE_POINT : codePoint$iv;
|
||||
yield.invoke(Integer.valueOf(it));
|
||||
Unit unit2 = Unit.INSTANCE;
|
||||
i = 2;
|
||||
} else {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit3 = Unit.INSTANCE;
|
||||
i = 1;
|
||||
}
|
||||
}
|
||||
index += i;
|
||||
} else {
|
||||
int other$iv2 = b0 >> 4;
|
||||
if (other$iv2 == -2) {
|
||||
if (endIndex <= index + 2) {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit4 = Unit.INSTANCE;
|
||||
int it2 = index + 1;
|
||||
if (endIndex > it2) {
|
||||
int byte$iv$iv = processUtf8CodePoints[index + 1];
|
||||
int other$iv$iv$iv2 = 192 & byte$iv$iv;
|
||||
if (other$iv$iv$iv2 == 128) {
|
||||
i2 = 2;
|
||||
}
|
||||
}
|
||||
i2 = 1;
|
||||
} else {
|
||||
byte b0$iv2 = processUtf8CodePoints[index];
|
||||
byte b1$iv3 = processUtf8CodePoints[index + 1];
|
||||
if ((b1$iv3 & 192) == 128) {
|
||||
byte b2$iv = processUtf8CodePoints[index + 2];
|
||||
if ((b2$iv & 192) == 128) {
|
||||
int codePoint$iv2 = (((-123008) ^ b2$iv) ^ (b1$iv3 << 6)) ^ (b0$iv2 << Ascii.f159FF);
|
||||
int it3 = codePoint$iv2 < 2048 ? REPLACEMENT_CODE_POINT : (55296 <= codePoint$iv2 && 57343 >= codePoint$iv2) ? REPLACEMENT_CODE_POINT : codePoint$iv2;
|
||||
yield.invoke(Integer.valueOf(it3));
|
||||
Unit unit5 = Unit.INSTANCE;
|
||||
i2 = 3;
|
||||
} else {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit6 = Unit.INSTANCE;
|
||||
i2 = 2;
|
||||
}
|
||||
} else {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit7 = Unit.INSTANCE;
|
||||
i2 = 1;
|
||||
}
|
||||
}
|
||||
index += i2;
|
||||
} else {
|
||||
int other$iv3 = b0 >> 3;
|
||||
if (other$iv3 == -2) {
|
||||
if (endIndex <= index + 3) {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit8 = Unit.INSTANCE;
|
||||
int it4 = index + 1;
|
||||
if (endIndex > it4) {
|
||||
int byte$iv$iv2 = processUtf8CodePoints[index + 1];
|
||||
int other$iv$iv$iv3 = 192 & byte$iv$iv2;
|
||||
if (other$iv$iv$iv3 == 128) {
|
||||
if (endIndex > index + 2) {
|
||||
int byte$iv$iv3 = processUtf8CodePoints[index + 2];
|
||||
int other$iv$iv$iv4 = 192 & byte$iv$iv3;
|
||||
if (other$iv$iv$iv4 == 128) {
|
||||
b1$iv = 3;
|
||||
}
|
||||
}
|
||||
b1$iv = 2;
|
||||
}
|
||||
}
|
||||
b1$iv = 1;
|
||||
} else {
|
||||
byte b0$iv3 = processUtf8CodePoints[index];
|
||||
byte b1$iv4 = processUtf8CodePoints[index + 1];
|
||||
if ((b1$iv4 & 192) == 128) {
|
||||
byte b2$iv2 = processUtf8CodePoints[index + 2];
|
||||
if ((b2$iv2 & 192) == 128) {
|
||||
byte b3$iv = processUtf8CodePoints[index + 3];
|
||||
if ((b3$iv & 192) == 128) {
|
||||
int codePoint$iv3 = (((3678080 ^ b3$iv) ^ (b2$iv2 << 6)) ^ (b1$iv4 << Ascii.f159FF)) ^ (b0$iv3 << Ascii.DC2);
|
||||
int it5 = codePoint$iv3 > 1114111 ? REPLACEMENT_CODE_POINT : (55296 <= codePoint$iv3 && 57343 >= codePoint$iv3) ? REPLACEMENT_CODE_POINT : codePoint$iv3 < 65536 ? REPLACEMENT_CODE_POINT : codePoint$iv3;
|
||||
yield.invoke(Integer.valueOf(it5));
|
||||
Unit unit9 = Unit.INSTANCE;
|
||||
b1$iv = 4;
|
||||
} else {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit10 = Unit.INSTANCE;
|
||||
b1$iv = 3;
|
||||
}
|
||||
} else {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit11 = Unit.INSTANCE;
|
||||
b1$iv = 2;
|
||||
}
|
||||
} else {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
Unit unit12 = Unit.INSTANCE;
|
||||
b1$iv = 1;
|
||||
}
|
||||
}
|
||||
index += b1$iv;
|
||||
} else {
|
||||
yield.invoke(Integer.valueOf(REPLACEMENT_CODE_POINT));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX ERROR: JadxRuntimeException in pass: IfRegionVisitor
|
||||
jadx.core.utils.exceptions.JadxRuntimeException: Can't remove SSA var: r12v12 'codePoint' int, still in use, count: 2, list:
|
||||
(r12v12 'codePoint' int A[D('codePoint' int)]) from 0x02fb: IF (r12v12 'codePoint' int A[D('codePoint' int)]) != (65533 int) -> B:75:0x02bc A[HIDDEN] (LINE:282)
|
||||
(r12v12 'codePoint' int) from 0x02bc: PHI (r12v16 'codePoint' int) = (r12v12 'codePoint' int), (r12v13 'codePoint' int), (r12v15 'codePoint' int), (r12v17 'codePoint' int) binds: [B:89:0x02fb, B:87:0x02f6, B:83:0x02eb, B:74:0x02ba] A[DONT_GENERATE, DONT_INLINE]
|
||||
at jadx.core.utils.InsnRemover.removeSsaVar(InsnRemover.java:162)
|
||||
at jadx.core.utils.InsnRemover.unbindResult(InsnRemover.java:127)
|
||||
at jadx.core.dex.visitors.regions.TernaryMod.makeTernaryInsn(TernaryMod.java:125)
|
||||
at jadx.core.dex.visitors.regions.TernaryMod.processRegion(TernaryMod.java:62)
|
||||
at jadx.core.dex.visitors.regions.TernaryMod.enterRegion(TernaryMod.java:45)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:67)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1117)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.lambda$traverseInternal$0(DepthRegionTraversal.java:68)
|
||||
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverseInternal(DepthRegionTraversal.java:68)
|
||||
at jadx.core.dex.visitors.regions.DepthRegionTraversal.traverse(DepthRegionTraversal.java:19)
|
||||
at jadx.core.dex.visitors.regions.TernaryMod.process(TernaryMod.java:35)
|
||||
at jadx.core.dex.visitors.regions.IfRegionVisitor.process(IfRegionVisitor.java:34)
|
||||
at jadx.core.dex.visitors.regions.IfRegionVisitor.visit(IfRegionVisitor.java:30)
|
||||
*/
|
||||
public static final void processUtf16Chars(byte[] r24, int r25, int r26, kotlin.jvm.functions.Function1<? super java.lang.Character, kotlin.Unit> r27) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 784
|
||||
To view this dump add '--comments-level debug' option
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: okio.Utf8.processUtf16Chars(byte[], int, int, kotlin.jvm.functions.Function1):void");
|
||||
}
|
||||
|
||||
public static final int process2Utf8Bytes(byte[] process2Utf8Bytes, int beginIndex, int endIndex, Function1<? super Integer, Unit> yield) {
|
||||
Intrinsics.checkNotNullParameter(process2Utf8Bytes, "$this$process2Utf8Bytes");
|
||||
Intrinsics.checkNotNullParameter(yield, "yield");
|
||||
int i = beginIndex + 1;
|
||||
Integer valueOf = Integer.valueOf(REPLACEMENT_CODE_POINT);
|
||||
if (endIndex <= i) {
|
||||
yield.invoke(valueOf);
|
||||
return 1;
|
||||
}
|
||||
byte b0 = process2Utf8Bytes[beginIndex];
|
||||
int b1 = process2Utf8Bytes[beginIndex + 1];
|
||||
int other$iv$iv = 192 & b1;
|
||||
if (!(other$iv$iv == 128)) {
|
||||
yield.invoke(valueOf);
|
||||
return 1;
|
||||
}
|
||||
int codePoint = (b1 ^ MASK_2BYTES) ^ (b0 << 6);
|
||||
if (codePoint < 128) {
|
||||
yield.invoke(valueOf);
|
||||
return 2;
|
||||
}
|
||||
yield.invoke(Integer.valueOf(codePoint));
|
||||
return 2;
|
||||
}
|
||||
|
||||
public static final int process3Utf8Bytes(byte[] process3Utf8Bytes, int beginIndex, int endIndex, Function1<? super Integer, Unit> yield) {
|
||||
Intrinsics.checkNotNullParameter(process3Utf8Bytes, "$this$process3Utf8Bytes");
|
||||
Intrinsics.checkNotNullParameter(yield, "yield");
|
||||
int i = beginIndex + 2;
|
||||
Integer valueOf = Integer.valueOf(REPLACEMENT_CODE_POINT);
|
||||
if (endIndex <= i) {
|
||||
yield.invoke(valueOf);
|
||||
if (endIndex > beginIndex + 1) {
|
||||
int byte$iv = process3Utf8Bytes[beginIndex + 1];
|
||||
int other$iv$iv = 192 & byte$iv;
|
||||
if (other$iv$iv == 128) {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
byte b0 = process3Utf8Bytes[beginIndex];
|
||||
int b1 = process3Utf8Bytes[beginIndex + 1];
|
||||
int other$iv$iv2 = 192 & b1;
|
||||
if (!(other$iv$iv2 == 128)) {
|
||||
yield.invoke(valueOf);
|
||||
return 1;
|
||||
}
|
||||
int b2 = process3Utf8Bytes[beginIndex + 2];
|
||||
int other$iv$iv3 = 192 & b2;
|
||||
if (!(other$iv$iv3 == 128)) {
|
||||
yield.invoke(valueOf);
|
||||
return 2;
|
||||
}
|
||||
int codePoint = (((-123008) ^ b2) ^ (b1 << 6)) ^ (b0 << Ascii.f159FF);
|
||||
if (codePoint < 2048) {
|
||||
yield.invoke(valueOf);
|
||||
return 3;
|
||||
}
|
||||
if (55296 <= codePoint && 57343 >= codePoint) {
|
||||
yield.invoke(valueOf);
|
||||
return 3;
|
||||
}
|
||||
yield.invoke(Integer.valueOf(codePoint));
|
||||
return 3;
|
||||
}
|
||||
|
||||
public static final int process4Utf8Bytes(byte[] process4Utf8Bytes, int beginIndex, int endIndex, Function1<? super Integer, Unit> yield) {
|
||||
Intrinsics.checkNotNullParameter(process4Utf8Bytes, "$this$process4Utf8Bytes");
|
||||
Intrinsics.checkNotNullParameter(yield, "yield");
|
||||
int i = beginIndex + 3;
|
||||
Integer valueOf = Integer.valueOf(REPLACEMENT_CODE_POINT);
|
||||
if (endIndex <= i) {
|
||||
yield.invoke(valueOf);
|
||||
if (endIndex > beginIndex + 1) {
|
||||
int byte$iv = process4Utf8Bytes[beginIndex + 1];
|
||||
int other$iv$iv = 192 & byte$iv;
|
||||
if (other$iv$iv == 128) {
|
||||
if (endIndex > beginIndex + 2) {
|
||||
int byte$iv2 = process4Utf8Bytes[beginIndex + 2];
|
||||
int other$iv$iv2 = 192 & byte$iv2;
|
||||
if (other$iv$iv2 == 128) {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
byte b0 = process4Utf8Bytes[beginIndex];
|
||||
int b1 = process4Utf8Bytes[beginIndex + 1];
|
||||
int other$iv$iv3 = 192 & b1;
|
||||
if (!(other$iv$iv3 == 128)) {
|
||||
yield.invoke(valueOf);
|
||||
return 1;
|
||||
}
|
||||
int b2 = process4Utf8Bytes[beginIndex + 2];
|
||||
int other$iv$iv4 = 192 & b2;
|
||||
if (!(other$iv$iv4 == 128)) {
|
||||
yield.invoke(valueOf);
|
||||
return 2;
|
||||
}
|
||||
int b3 = process4Utf8Bytes[beginIndex + 3];
|
||||
int other$iv$iv5 = 192 & b3;
|
||||
if (!(other$iv$iv5 == 128)) {
|
||||
yield.invoke(valueOf);
|
||||
return 3;
|
||||
}
|
||||
int codePoint = (((3678080 ^ b3) ^ (b2 << 6)) ^ (b1 << 12)) ^ (b0 << Ascii.DC2);
|
||||
if (codePoint > 1114111) {
|
||||
yield.invoke(valueOf);
|
||||
return 4;
|
||||
}
|
||||
if (55296 <= codePoint && 57343 >= codePoint) {
|
||||
yield.invoke(valueOf);
|
||||
return 4;
|
||||
}
|
||||
if (codePoint < 65536) {
|
||||
yield.invoke(valueOf);
|
||||
return 4;
|
||||
}
|
||||
yield.invoke(Integer.valueOf(codePoint));
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package okio;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import okio.internal.ByteStringKt;
|
||||
|
||||
/* compiled from: -Util.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000:\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010\u0005\n\u0002\b\u0002\n\u0002\u0010\n\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\u001a0\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00032\u0006\u0010\u0007\u001a\u00020\u00052\u0006\u0010\b\u001a\u00020\u0005H\u0000\u001a \u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\b\u001a\u00020\fH\u0000\u001a\u0019\u0010\u000e\u001a\u00020\f2\u0006\u0010\u0002\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\fH\u0080\b\u001a\u0019\u0010\u000e\u001a\u00020\f2\u0006\u0010\u0002\u001a\u00020\f2\u0006\u0010\u0006\u001a\u00020\u0005H\u0080\b\u001a\u0015\u0010\u000f\u001a\u00020\u0005*\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u0005H\u0080\f\u001a\u0015\u0010\u000f\u001a\u00020\f*\u00020\u00102\u0006\u0010\u0011\u001a\u00020\fH\u0080\f\u001a\u0015\u0010\u000f\u001a\u00020\f*\u00020\u00052\u0006\u0010\u0011\u001a\u00020\fH\u0080\f\u001a\f\u0010\u0012\u001a\u00020\u0005*\u00020\u0005H\u0000\u001a\f\u0010\u0012\u001a\u00020\f*\u00020\fH\u0000\u001a\f\u0010\u0012\u001a\u00020\u0013*\u00020\u0013H\u0000\u001a\u0015\u0010\u0014\u001a\u00020\u0005*\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u0005H\u0080\f\u001a\u0015\u0010\u0015\u001a\u00020\u0005*\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u0005H\u0080\f\u001a\f\u0010\u0016\u001a\u00020\u0017*\u00020\u0010H\u0000\u001a\f\u0010\u0016\u001a\u00020\u0017*\u00020\u0005H\u0000\u001a\f\u0010\u0016\u001a\u00020\u0017*\u00020\fH\u0000¨\u0006\u0018"}, m238d2 = {"arrayRangeEquals", "", "a", "", "aOffset", "", "b", "bOffset", "byteCount", "checkOffsetAndCount", "", "size", "", TypedValues.Cycle.S_WAVE_OFFSET, "minOf", "and", "", "other", "reverseBytes", "", "shl", "shr", "toHexString", "", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.-Util, reason: invalid class name */
|
||||
/* loaded from: classes11.dex */
|
||||
public final class Util {
|
||||
public static final void checkOffsetAndCount(long size, long offset, long byteCount) {
|
||||
if ((offset | byteCount) < 0 || offset > size || size - offset < byteCount) {
|
||||
throw new ArrayIndexOutOfBoundsException("size=" + size + " offset=" + offset + " byteCount=" + byteCount);
|
||||
}
|
||||
}
|
||||
|
||||
public static final short reverseBytes(short $this$reverseBytes) {
|
||||
int i = 65535 & $this$reverseBytes;
|
||||
int reversed = ((65280 & i) >>> 8) | ((i & 255) << 8);
|
||||
return (short) reversed;
|
||||
}
|
||||
|
||||
public static final int reverseBytes(int $this$reverseBytes) {
|
||||
return (((-16777216) & $this$reverseBytes) >>> 24) | ((16711680 & $this$reverseBytes) >>> 8) | ((65280 & $this$reverseBytes) << 8) | (($this$reverseBytes & 255) << 24);
|
||||
}
|
||||
|
||||
public static final long reverseBytes(long $this$reverseBytes) {
|
||||
return (((-72057594037927936L) & $this$reverseBytes) >>> 56) | ((71776119061217280L & $this$reverseBytes) >>> 40) | ((280375465082880L & $this$reverseBytes) >>> 24) | ((1095216660480L & $this$reverseBytes) >>> 8) | ((4278190080L & $this$reverseBytes) << 8) | ((16711680 & $this$reverseBytes) << 24) | ((65280 & $this$reverseBytes) << 40) | ((255 & $this$reverseBytes) << 56);
|
||||
}
|
||||
|
||||
public static final int shr(byte $this$shr, int other) {
|
||||
return $this$shr >> other;
|
||||
}
|
||||
|
||||
public static final int shl(byte $this$shl, int other) {
|
||||
return $this$shl << other;
|
||||
}
|
||||
|
||||
public static final int and(byte $this$and, int other) {
|
||||
return $this$and & other;
|
||||
}
|
||||
|
||||
public static final long and(byte $this$and, long other) {
|
||||
return $this$and & other;
|
||||
}
|
||||
|
||||
public static final long and(int $this$and, long other) {
|
||||
return $this$and & other;
|
||||
}
|
||||
|
||||
public static final long minOf(long a, int b) {
|
||||
return Math.min(a, b);
|
||||
}
|
||||
|
||||
public static final long minOf(int a, long b) {
|
||||
return Math.min(a, b);
|
||||
}
|
||||
|
||||
public static final boolean arrayRangeEquals(byte[] a, int aOffset, byte[] b, int bOffset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(a, "a");
|
||||
Intrinsics.checkNotNullParameter(b, "b");
|
||||
for (int i = 0; i < byteCount; i++) {
|
||||
if (a[i + aOffset] != b[i + bOffset]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final String toHexString(byte $this$toHexString) {
|
||||
int other$iv = $this$toHexString >> 4;
|
||||
int other$iv2 = 15 & $this$toHexString;
|
||||
char[] result = {ByteStringKt.getHEX_DIGIT_CHARS()[other$iv & 15], ByteStringKt.getHEX_DIGIT_CHARS()[other$iv2]};
|
||||
return new String(result);
|
||||
}
|
||||
|
||||
public static final String toHexString(int $this$toHexString) {
|
||||
if ($this$toHexString == 0) {
|
||||
return "0";
|
||||
}
|
||||
char[] result = {ByteStringKt.getHEX_DIGIT_CHARS()[($this$toHexString >> 28) & 15], ByteStringKt.getHEX_DIGIT_CHARS()[($this$toHexString >> 24) & 15], ByteStringKt.getHEX_DIGIT_CHARS()[($this$toHexString >> 20) & 15], ByteStringKt.getHEX_DIGIT_CHARS()[($this$toHexString >> 16) & 15], ByteStringKt.getHEX_DIGIT_CHARS()[($this$toHexString >> 12) & 15], ByteStringKt.getHEX_DIGIT_CHARS()[($this$toHexString >> 8) & 15], ByteStringKt.getHEX_DIGIT_CHARS()[($this$toHexString >> 4) & 15], ByteStringKt.getHEX_DIGIT_CHARS()[$this$toHexString & 15]};
|
||||
int i = 0;
|
||||
while (i < result.length && result[i] == '0') {
|
||||
i++;
|
||||
}
|
||||
return new String(result, i, result.length - i);
|
||||
}
|
||||
|
||||
public static final String toHexString(long $this$toHexString) {
|
||||
if ($this$toHexString == 0) {
|
||||
return "0";
|
||||
}
|
||||
char[] result = {ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 60) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 56) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 52) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 48) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 44) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 40) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 36) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 32) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 28) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 24) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 20) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 16) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 12) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 8) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) (($this$toHexString >> 4) & 15)], ByteStringKt.getHEX_DIGIT_CHARS()[(int) ($this$toHexString & 15)]};
|
||||
int i = 0;
|
||||
while (i < result.length && result[i] == '0') {
|
||||
i++;
|
||||
}
|
||||
return new String(result, i, result.length - i);
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,608 @@
|
||||
package okio.internal;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.util.Arrays;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.StringsKt;
|
||||
import okio.Base64;
|
||||
import okio.Buffer;
|
||||
import okio.ByteString;
|
||||
import okio.Platform;
|
||||
import okio.Util;
|
||||
|
||||
/* compiled from: ByteString.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000P\n\u0000\n\u0002\u0010\u0019\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\f\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0007\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0005\n\u0002\b\u0018\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0018\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u0005H\u0002\u001a\u0011\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u0007H\u0080\b\u001a\u0010\u0010\f\u001a\u00020\u00052\u0006\u0010\r\u001a\u00020\u000eH\u0002\u001a\r\u0010\u000f\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\r\u0010\u0011\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\u0015\u0010\u0012\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\nH\u0080\b\u001a\u000f\u0010\u0014\u001a\u0004\u0018\u00010\n*\u00020\u0010H\u0080\b\u001a\r\u0010\u0015\u001a\u00020\n*\u00020\u0010H\u0080\b\u001a\r\u0010\u0016\u001a\u00020\n*\u00020\u0010H\u0080\b\u001a\u0015\u0010\u0017\u001a\u00020\u0018*\u00020\n2\u0006\u0010\u0019\u001a\u00020\u0007H\u0080\b\u001a\u0015\u0010\u0017\u001a\u00020\u0018*\u00020\n2\u0006\u0010\u0019\u001a\u00020\nH\u0080\b\u001a\u0017\u0010\u001a\u001a\u00020\u0018*\u00020\n2\b\u0010\u0013\u001a\u0004\u0018\u00010\u001bH\u0080\b\u001a\u0015\u0010\u001c\u001a\u00020\u001d*\u00020\n2\u0006\u0010\u001e\u001a\u00020\u0005H\u0080\b\u001a\r\u0010\u001f\u001a\u00020\u0005*\u00020\nH\u0080\b\u001a\r\u0010 \u001a\u00020\u0005*\u00020\nH\u0080\b\u001a\r\u0010!\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\u001d\u0010\"\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\u00072\u0006\u0010#\u001a\u00020\u0005H\u0080\b\u001a\r\u0010$\u001a\u00020\u0007*\u00020\nH\u0080\b\u001a\u001d\u0010%\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\u00072\u0006\u0010#\u001a\u00020\u0005H\u0080\b\u001a\u001d\u0010%\u001a\u00020\u0005*\u00020\n2\u0006\u0010\u0013\u001a\u00020\n2\u0006\u0010#\u001a\u00020\u0005H\u0080\b\u001a-\u0010&\u001a\u00020\u0018*\u00020\n2\u0006\u0010'\u001a\u00020\u00052\u0006\u0010\u0013\u001a\u00020\u00072\u0006\u0010(\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0080\b\u001a-\u0010&\u001a\u00020\u0018*\u00020\n2\u0006\u0010'\u001a\u00020\u00052\u0006\u0010\u0013\u001a\u00020\n2\u0006\u0010(\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0080\b\u001a\u0015\u0010*\u001a\u00020\u0018*\u00020\n2\u0006\u0010+\u001a\u00020\u0007H\u0080\b\u001a\u0015\u0010*\u001a\u00020\u0018*\u00020\n2\u0006\u0010+\u001a\u00020\nH\u0080\b\u001a\u001d\u0010,\u001a\u00020\n*\u00020\n2\u0006\u0010-\u001a\u00020\u00052\u0006\u0010.\u001a\u00020\u0005H\u0080\b\u001a\r\u0010/\u001a\u00020\n*\u00020\nH\u0080\b\u001a\r\u00100\u001a\u00020\n*\u00020\nH\u0080\b\u001a\r\u00101\u001a\u00020\u0007*\u00020\nH\u0080\b\u001a\u001d\u00102\u001a\u00020\n*\u00020\u00072\u0006\u0010'\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0080\b\u001a\r\u00103\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a\r\u00104\u001a\u00020\u0010*\u00020\nH\u0080\b\u001a$\u00105\u001a\u000206*\u00020\n2\u0006\u00107\u001a\u0002082\u0006\u0010'\u001a\u00020\u00052\u0006\u0010)\u001a\u00020\u0005H\u0000\"\u0014\u0010\u0000\u001a\u00020\u0001X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u0003¨\u00069"}, m238d2 = {"HEX_DIGIT_CHARS", "", "getHEX_DIGIT_CHARS", "()[C", "codePointIndexToCharIndex", "", "s", "", "codePointCount", "commonOf", "Lokio/ByteString;", "data", "decodeHexDigit", "c", "", "commonBase64", "", "commonBase64Url", "commonCompareTo", "other", "commonDecodeBase64", "commonDecodeHex", "commonEncodeUtf8", "commonEndsWith", "", "suffix", "commonEquals", "", "commonGetByte", "", "pos", "commonGetSize", "commonHashCode", "commonHex", "commonIndexOf", "fromIndex", "commonInternalArray", "commonLastIndexOf", "commonRangeEquals", TypedValues.Cycle.S_WAVE_OFFSET, "otherOffset", "byteCount", "commonStartsWith", "prefix", "commonSubstring", "beginIndex", "endIndex", "commonToAsciiLowercase", "commonToAsciiUppercase", "commonToByteArray", "commonToByteString", "commonToString", "commonUtf8", "commonWrite", "", "buffer", "Lokio/Buffer;", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class ByteStringKt {
|
||||
private static final char[] HEX_DIGIT_CHARS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||
|
||||
public static final String commonUtf8(ByteString commonUtf8) {
|
||||
Intrinsics.checkNotNullParameter(commonUtf8, "$this$commonUtf8");
|
||||
String result = commonUtf8.getUtf8();
|
||||
if (result == null) {
|
||||
String result2 = Platform.toUtf8String(commonUtf8.internalArray$okio());
|
||||
commonUtf8.setUtf8$okio(result2);
|
||||
return result2;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final String commonBase64(ByteString commonBase64) {
|
||||
Intrinsics.checkNotNullParameter(commonBase64, "$this$commonBase64");
|
||||
return Base64.encodeBase64$default(commonBase64.getData(), null, 1, null);
|
||||
}
|
||||
|
||||
public static final String commonBase64Url(ByteString commonBase64Url) {
|
||||
Intrinsics.checkNotNullParameter(commonBase64Url, "$this$commonBase64Url");
|
||||
return Base64.encodeBase64(commonBase64Url.getData(), Base64.getBASE64_URL_SAFE());
|
||||
}
|
||||
|
||||
public static final char[] getHEX_DIGIT_CHARS() {
|
||||
return HEX_DIGIT_CHARS;
|
||||
}
|
||||
|
||||
public static final String commonHex(ByteString commonHex) {
|
||||
Intrinsics.checkNotNullParameter(commonHex, "$this$commonHex");
|
||||
char[] result = new char[commonHex.getData().length * 2];
|
||||
int c = 0;
|
||||
for (int b : commonHex.getData()) {
|
||||
int c2 = c + 1;
|
||||
int other$iv = b >> 4;
|
||||
result[c] = getHEX_DIGIT_CHARS()[other$iv & 15];
|
||||
c = c2 + 1;
|
||||
int other$iv2 = 15 & b;
|
||||
result[c2] = getHEX_DIGIT_CHARS()[other$iv2];
|
||||
}
|
||||
return new String(result);
|
||||
}
|
||||
|
||||
public static final ByteString commonToAsciiLowercase(ByteString commonToAsciiLowercase) {
|
||||
byte b;
|
||||
Intrinsics.checkNotNullParameter(commonToAsciiLowercase, "$this$commonToAsciiLowercase");
|
||||
for (int i = 0; i < commonToAsciiLowercase.getData().length; i++) {
|
||||
byte c = commonToAsciiLowercase.getData()[i];
|
||||
byte b2 = (byte) 65;
|
||||
if (c >= b2 && c <= (b = (byte) 90)) {
|
||||
byte[] data = commonToAsciiLowercase.getData();
|
||||
byte[] lowercase = Arrays.copyOf(data, data.length);
|
||||
Intrinsics.checkNotNullExpressionValue(lowercase, "java.util.Arrays.copyOf(this, size)");
|
||||
int i2 = i + 1;
|
||||
lowercase[i] = (byte) (c + 32);
|
||||
while (i2 < lowercase.length) {
|
||||
byte c2 = lowercase[i2];
|
||||
if (c2 < b2 || c2 > b) {
|
||||
i2++;
|
||||
} else {
|
||||
lowercase[i2] = (byte) (c2 + 32);
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
return new ByteString(lowercase);
|
||||
}
|
||||
}
|
||||
return commonToAsciiLowercase;
|
||||
}
|
||||
|
||||
public static final ByteString commonToAsciiUppercase(ByteString commonToAsciiUppercase) {
|
||||
byte b;
|
||||
Intrinsics.checkNotNullParameter(commonToAsciiUppercase, "$this$commonToAsciiUppercase");
|
||||
for (int i = 0; i < commonToAsciiUppercase.getData().length; i++) {
|
||||
byte c = commonToAsciiUppercase.getData()[i];
|
||||
byte b2 = (byte) 97;
|
||||
if (c >= b2 && c <= (b = (byte) 122)) {
|
||||
byte[] data = commonToAsciiUppercase.getData();
|
||||
byte[] lowercase = Arrays.copyOf(data, data.length);
|
||||
Intrinsics.checkNotNullExpressionValue(lowercase, "java.util.Arrays.copyOf(this, size)");
|
||||
int i2 = i + 1;
|
||||
lowercase[i] = (byte) (c - 32);
|
||||
while (i2 < lowercase.length) {
|
||||
byte c2 = lowercase[i2];
|
||||
if (c2 < b2 || c2 > b) {
|
||||
i2++;
|
||||
} else {
|
||||
lowercase[i2] = (byte) (c2 - 32);
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
return new ByteString(lowercase);
|
||||
}
|
||||
}
|
||||
return commonToAsciiUppercase;
|
||||
}
|
||||
|
||||
public static final ByteString commonSubstring(ByteString commonSubstring, int beginIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonSubstring, "$this$commonSubstring");
|
||||
if (!(beginIndex >= 0)) {
|
||||
throw new IllegalArgumentException("beginIndex < 0".toString());
|
||||
}
|
||||
if (!(endIndex <= commonSubstring.getData().length)) {
|
||||
throw new IllegalArgumentException(("endIndex > length(" + commonSubstring.getData().length + ')').toString());
|
||||
}
|
||||
int subLen = endIndex - beginIndex;
|
||||
if (!(subLen >= 0)) {
|
||||
throw new IllegalArgumentException("endIndex < beginIndex".toString());
|
||||
}
|
||||
if (beginIndex == 0 && endIndex == commonSubstring.getData().length) {
|
||||
return commonSubstring;
|
||||
}
|
||||
return new ByteString(ArraysKt.copyOfRange(commonSubstring.getData(), beginIndex, endIndex));
|
||||
}
|
||||
|
||||
public static final byte commonGetByte(ByteString commonGetByte, int pos) {
|
||||
Intrinsics.checkNotNullParameter(commonGetByte, "$this$commonGetByte");
|
||||
return commonGetByte.getData()[pos];
|
||||
}
|
||||
|
||||
public static final int commonGetSize(ByteString commonGetSize) {
|
||||
Intrinsics.checkNotNullParameter(commonGetSize, "$this$commonGetSize");
|
||||
return commonGetSize.getData().length;
|
||||
}
|
||||
|
||||
public static final byte[] commonToByteArray(ByteString commonToByteArray) {
|
||||
Intrinsics.checkNotNullParameter(commonToByteArray, "$this$commonToByteArray");
|
||||
byte[] data = commonToByteArray.getData();
|
||||
byte[] copyOf = Arrays.copyOf(data, data.length);
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
|
||||
return copyOf;
|
||||
}
|
||||
|
||||
public static final byte[] commonInternalArray(ByteString commonInternalArray) {
|
||||
Intrinsics.checkNotNullParameter(commonInternalArray, "$this$commonInternalArray");
|
||||
return commonInternalArray.getData();
|
||||
}
|
||||
|
||||
public static final boolean commonRangeEquals(ByteString commonRangeEquals, int offset, ByteString other, int otherOffset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRangeEquals, "$this$commonRangeEquals");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
return other.rangeEquals(otherOffset, commonRangeEquals.getData(), offset, byteCount);
|
||||
}
|
||||
|
||||
public static final boolean commonRangeEquals(ByteString commonRangeEquals, int offset, byte[] other, int otherOffset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRangeEquals, "$this$commonRangeEquals");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
return offset >= 0 && offset <= commonRangeEquals.getData().length - byteCount && otherOffset >= 0 && otherOffset <= other.length - byteCount && Util.arrayRangeEquals(commonRangeEquals.getData(), offset, other, otherOffset, byteCount);
|
||||
}
|
||||
|
||||
public static final boolean commonStartsWith(ByteString commonStartsWith, ByteString prefix) {
|
||||
Intrinsics.checkNotNullParameter(commonStartsWith, "$this$commonStartsWith");
|
||||
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
||||
return commonStartsWith.rangeEquals(0, prefix, 0, prefix.size());
|
||||
}
|
||||
|
||||
public static final boolean commonStartsWith(ByteString commonStartsWith, byte[] prefix) {
|
||||
Intrinsics.checkNotNullParameter(commonStartsWith, "$this$commonStartsWith");
|
||||
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
||||
return commonStartsWith.rangeEquals(0, prefix, 0, prefix.length);
|
||||
}
|
||||
|
||||
public static final boolean commonEndsWith(ByteString commonEndsWith, ByteString suffix) {
|
||||
Intrinsics.checkNotNullParameter(commonEndsWith, "$this$commonEndsWith");
|
||||
Intrinsics.checkNotNullParameter(suffix, "suffix");
|
||||
return commonEndsWith.rangeEquals(commonEndsWith.size() - suffix.size(), suffix, 0, suffix.size());
|
||||
}
|
||||
|
||||
public static final boolean commonEndsWith(ByteString commonEndsWith, byte[] suffix) {
|
||||
Intrinsics.checkNotNullParameter(commonEndsWith, "$this$commonEndsWith");
|
||||
Intrinsics.checkNotNullParameter(suffix, "suffix");
|
||||
return commonEndsWith.rangeEquals(commonEndsWith.size() - suffix.length, suffix, 0, suffix.length);
|
||||
}
|
||||
|
||||
public static final int commonIndexOf(ByteString commonIndexOf, byte[] other, int fromIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonIndexOf, "$this$commonIndexOf");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
int limit = commonIndexOf.getData().length - other.length;
|
||||
int i = Math.max(fromIndex, 0);
|
||||
if (i <= limit) {
|
||||
while (!Util.arrayRangeEquals(commonIndexOf.getData(), i, other, 0, other.length)) {
|
||||
if (i == limit) {
|
||||
return -1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static final int commonLastIndexOf(ByteString commonLastIndexOf, ByteString other, int fromIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonLastIndexOf, "$this$commonLastIndexOf");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
return commonLastIndexOf.lastIndexOf(other.internalArray$okio(), fromIndex);
|
||||
}
|
||||
|
||||
public static final int commonLastIndexOf(ByteString commonLastIndexOf, byte[] other, int fromIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonLastIndexOf, "$this$commonLastIndexOf");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
int limit = commonLastIndexOf.getData().length - other.length;
|
||||
for (int i = Math.min(fromIndex, limit); i >= 0; i--) {
|
||||
if (Util.arrayRangeEquals(commonLastIndexOf.getData(), i, other, 0, other.length)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static final boolean commonEquals(ByteString commonEquals, Object other) {
|
||||
Intrinsics.checkNotNullParameter(commonEquals, "$this$commonEquals");
|
||||
if (other == commonEquals) {
|
||||
return true;
|
||||
}
|
||||
if (other instanceof ByteString) {
|
||||
return ((ByteString) other).size() == commonEquals.getData().length && ((ByteString) other).rangeEquals(0, commonEquals.getData(), 0, commonEquals.getData().length);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final int commonHashCode(ByteString commonHashCode) {
|
||||
Intrinsics.checkNotNullParameter(commonHashCode, "$this$commonHashCode");
|
||||
int result = commonHashCode.getHashCode();
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
int it = Arrays.hashCode(commonHashCode.getData());
|
||||
commonHashCode.setHashCode$okio(it);
|
||||
return it;
|
||||
}
|
||||
|
||||
public static final int commonCompareTo(ByteString commonCompareTo, ByteString other) {
|
||||
Intrinsics.checkNotNullParameter(commonCompareTo, "$this$commonCompareTo");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
int sizeA = commonCompareTo.size();
|
||||
int sizeB = other.size();
|
||||
int size = Math.min(sizeA, sizeB);
|
||||
for (int i = 0; i < size; i++) {
|
||||
int $this$and$iv = commonCompareTo.getByte(i);
|
||||
int byteA = $this$and$iv & 255;
|
||||
byte $this$and$iv2 = other.getByte(i);
|
||||
int byteB = $this$and$iv2 & 255;
|
||||
if (byteA != byteB) {
|
||||
return byteA < byteB ? -1 : 1;
|
||||
}
|
||||
}
|
||||
if (sizeA == sizeB) {
|
||||
return 0;
|
||||
}
|
||||
return sizeA < sizeB ? -1 : 1;
|
||||
}
|
||||
|
||||
public static final ByteString commonOf(byte[] data) {
|
||||
Intrinsics.checkNotNullParameter(data, "data");
|
||||
byte[] copyOf = Arrays.copyOf(data, data.length);
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
|
||||
return new ByteString(copyOf);
|
||||
}
|
||||
|
||||
public static final ByteString commonToByteString(byte[] commonToByteString, int offset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonToByteString, "$this$commonToByteString");
|
||||
Util.checkOffsetAndCount(commonToByteString.length, offset, byteCount);
|
||||
return new ByteString(ArraysKt.copyOfRange(commonToByteString, offset, offset + byteCount));
|
||||
}
|
||||
|
||||
public static final ByteString commonEncodeUtf8(String commonEncodeUtf8) {
|
||||
Intrinsics.checkNotNullParameter(commonEncodeUtf8, "$this$commonEncodeUtf8");
|
||||
ByteString byteString = new ByteString(Platform.asUtf8ToByteArray(commonEncodeUtf8));
|
||||
byteString.setUtf8$okio(commonEncodeUtf8);
|
||||
return byteString;
|
||||
}
|
||||
|
||||
public static final ByteString commonDecodeBase64(String commonDecodeBase64) {
|
||||
Intrinsics.checkNotNullParameter(commonDecodeBase64, "$this$commonDecodeBase64");
|
||||
byte[] decoded = Base64.decodeBase64ToArray(commonDecodeBase64);
|
||||
if (decoded != null) {
|
||||
return new ByteString(decoded);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final ByteString commonDecodeHex(String commonDecodeHex) {
|
||||
Intrinsics.checkNotNullParameter(commonDecodeHex, "$this$commonDecodeHex");
|
||||
if (!(commonDecodeHex.length() % 2 == 0)) {
|
||||
throw new IllegalArgumentException(("Unexpected hex string: " + commonDecodeHex).toString());
|
||||
}
|
||||
byte[] result = new byte[commonDecodeHex.length() / 2];
|
||||
int length = result.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
int d1 = decodeHexDigit(commonDecodeHex.charAt(i * 2)) << 4;
|
||||
int d2 = decodeHexDigit(commonDecodeHex.charAt((i * 2) + 1));
|
||||
result[i] = (byte) (d1 + d2);
|
||||
}
|
||||
return new ByteString(result);
|
||||
}
|
||||
|
||||
public static final void commonWrite(ByteString commonWrite, Buffer buffer, int offset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(buffer, "buffer");
|
||||
buffer.write(commonWrite.getData(), offset, byteCount);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final int decodeHexDigit(char c) {
|
||||
if ('0' <= c && '9' >= c) {
|
||||
return c - '0';
|
||||
}
|
||||
if ('a' <= c && 'f' >= c) {
|
||||
return (c - 'a') + 10;
|
||||
}
|
||||
if ('A' <= c && 'F' >= c) {
|
||||
return (c - 'A') + 10;
|
||||
}
|
||||
throw new IllegalArgumentException("Unexpected hex digit: " + c);
|
||||
}
|
||||
|
||||
public static final String commonToString(ByteString commonToString) {
|
||||
Intrinsics.checkNotNullParameter(commonToString, "$this$commonToString");
|
||||
if (commonToString.getData().length == 0) {
|
||||
return "[size=0]";
|
||||
}
|
||||
int i = codePointIndexToCharIndex(commonToString.getData(), 64);
|
||||
if (i != -1) {
|
||||
String text = commonToString.utf8();
|
||||
if (text == null) {
|
||||
throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
|
||||
}
|
||||
String substring = text.substring(0, i);
|
||||
Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
|
||||
String safeText = StringsKt.replace$default(StringsKt.replace$default(StringsKt.replace$default(substring, "\\", "\\\\", false, 4, (Object) null), "\n", "\\n", false, 4, (Object) null), "\r", "\\r", false, 4, (Object) null);
|
||||
if (i >= text.length()) {
|
||||
return "[text=" + safeText + ']';
|
||||
}
|
||||
return "[size=" + commonToString.getData().length + " text=" + safeText + "…]";
|
||||
}
|
||||
if (commonToString.getData().length <= 64) {
|
||||
return "[hex=" + commonToString.hex() + ']';
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("[size=");
|
||||
sb.append(commonToString.getData().length);
|
||||
sb.append(" hex=");
|
||||
ByteString $this$commonSubstring$iv = commonToString;
|
||||
if (!(64 <= $this$commonSubstring$iv.getData().length)) {
|
||||
throw new IllegalArgumentException(("endIndex > length(" + $this$commonSubstring$iv.getData().length + ')').toString());
|
||||
}
|
||||
int subLen$iv = 64 - 0;
|
||||
if (!(subLen$iv >= 0)) {
|
||||
throw new IllegalArgumentException("endIndex < beginIndex".toString());
|
||||
}
|
||||
if (64 != $this$commonSubstring$iv.getData().length) {
|
||||
$this$commonSubstring$iv = new ByteString(ArraysKt.copyOfRange($this$commonSubstring$iv.getData(), 0, 64));
|
||||
}
|
||||
sb.append($this$commonSubstring$iv.hex());
|
||||
sb.append("…]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
/* JADX WARN: Code restructure failed: missing block: B:111:0x012d, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L109;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:112:0x013b, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:119:0x0139, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L110;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:142:0x0185, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L139;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:143:0x0193, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:150:0x0191, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L140;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:171:0x01c8, code lost:
|
||||
|
||||
if (31 >= r3) goto L168;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:172:0x01d6, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:179:0x01d4, code lost:
|
||||
|
||||
if (159 < r3) goto L169;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:225:0x025b, code lost:
|
||||
|
||||
if ((r10 == 128) == false) goto L221;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:247:0x029b, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L246;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:248:0x02a9, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:255:0x02a7, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L247;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:280:0x02fb, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L280;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:281:0x0309, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:288:0x0307, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L281;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:311:0x0357, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L311;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:312:0x0365, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:319:0x0363, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L312;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:346:0x03a7, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L345;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:347:0x03b5, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:354:0x03b3, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L346;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:359:0x03c2, code lost:
|
||||
|
||||
if (65533(0xfffd, float:9.1831E-41) < 65536(0x10000, float:9.1835E-41)) goto L380;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:360:0x03ff, code lost:
|
||||
|
||||
r1 = r1 + r17;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:361:0x03fd, code lost:
|
||||
|
||||
r17 = 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:375:0x03e0, code lost:
|
||||
|
||||
if (31 >= r4) goto L372;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:376:0x03ee, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:383:0x03ec, code lost:
|
||||
|
||||
if (159 < r4) goto L373;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:388:0x03fb, code lost:
|
||||
|
||||
if (r4 < 65536) goto L380;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:458:0x04cc, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L459;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:459:0x04da, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:466:0x04d8, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L460;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:491:0x052a, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L493;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:492:0x0538, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:499:0x0536, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L494;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:524:0x058b, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L528;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:525:0x0599, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:532:0x0597, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L529;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:555:0x05ec, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L558;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:556:0x05fa, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:563:0x05f8, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L559;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:590:0x063e, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L592;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:591:0x064c, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:598:0x064a, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L593;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:603:0x0659, code lost:
|
||||
|
||||
if (65533(0xfffd, float:9.1831E-41) < 65536(0x10000, float:9.1835E-41)) goto L600;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:604:0x065b, code lost:
|
||||
|
||||
r17 = 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:605:0x065d, code lost:
|
||||
|
||||
r1 = r1 + r17;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:621:0x0682, code lost:
|
||||
|
||||
if (31 >= 65533(0xfffd, float:9.1831E-41)) goto L622;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:622:0x0690, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:629:0x068e, code lost:
|
||||
|
||||
if (159(0x9f, float:2.23E-43) < 65533(0xfffd, float:9.1831E-41)) goto L623;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:634:0x069d, code lost:
|
||||
|
||||
if (65533(0xfffd, float:9.1831E-41) < 65536(0x10000, float:9.1835E-41)) goto L600;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:648:0x06bb, code lost:
|
||||
|
||||
if (31 >= r3) goto L649;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:649:0x06c9, code lost:
|
||||
|
||||
r16 = true;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:656:0x06c7, code lost:
|
||||
|
||||
if (159 < r3) goto L650;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:661:0x06d6, code lost:
|
||||
|
||||
if (r3 < 65536) goto L600;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public static final int codePointIndexToCharIndex(byte[] r29, int r30) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 1827
|
||||
To view this dump add '--comments-level debug' option
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: okio.internal.ByteStringKt.codePointIndexToCharIndex(byte[], int):int");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package okio.internal;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.EOFException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import okio.Buffer;
|
||||
import okio.BufferedSink;
|
||||
import okio.ByteString;
|
||||
import okio.Source;
|
||||
import okio.Timeout;
|
||||
import okio.buffer;
|
||||
|
||||
/* compiled from: RealBufferedSink.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000D\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0015\u001a\r\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u0080\b\u001a\r\u0010\u0003\u001a\u00020\u0004*\u00020\u0002H\u0080\b\u001a\r\u0010\u0005\u001a\u00020\u0004*\u00020\u0002H\u0080\b\u001a\r\u0010\u0006\u001a\u00020\u0001*\u00020\u0002H\u0080\b\u001a\r\u0010\u0007\u001a\u00020\b*\u00020\u0002H\u0080\b\u001a\r\u0010\t\u001a\u00020\n*\u00020\u0002H\u0080\b\u001a\u0015\u0010\u000b\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\f\u001a\u00020\rH\u0080\b\u001a%\u0010\u000b\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u000fH\u0080\b\u001a\u001d\u0010\u000b\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\f\u001a\u00020\u00112\u0006\u0010\u0010\u001a\u00020\u0012H\u0080\b\u001a\u0015\u0010\u000b\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u0013\u001a\u00020\u0014H\u0080\b\u001a%\u0010\u000b\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u000e\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u000fH\u0080\b\u001a\u001d\u0010\u000b\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\f\u001a\u00020\u00152\u0006\u0010\u0010\u001a\u00020\u0012H\u0080\b\u001a\u0015\u0010\u0016\u001a\u00020\u0012*\u00020\u00022\u0006\u0010\f\u001a\u00020\u0015H\u0080\b\u001a\u0015\u0010\u0017\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u0018\u001a\u00020\u000fH\u0080\b\u001a\u0015\u0010\u0019\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u001a\u001a\u00020\u0012H\u0080\b\u001a\u0015\u0010\u001b\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u001a\u001a\u00020\u0012H\u0080\b\u001a\u0015\u0010\u001c\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u001d\u001a\u00020\u000fH\u0080\b\u001a\u0015\u0010\u001e\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u001d\u001a\u00020\u000fH\u0080\b\u001a\u0015\u0010\u001f\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u001a\u001a\u00020\u0012H\u0080\b\u001a\u0015\u0010 \u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u001a\u001a\u00020\u0012H\u0080\b\u001a\u0015\u0010!\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\"\u001a\u00020\u000fH\u0080\b\u001a\u0015\u0010#\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\"\u001a\u00020\u000fH\u0080\b\u001a\u0015\u0010$\u001a\u00020\u0004*\u00020\u00022\u0006\u0010%\u001a\u00020\nH\u0080\b\u001a%\u0010$\u001a\u00020\u0004*\u00020\u00022\u0006\u0010%\u001a\u00020\n2\u0006\u0010&\u001a\u00020\u000f2\u0006\u0010'\u001a\u00020\u000fH\u0080\b\u001a\u0015\u0010(\u001a\u00020\u0004*\u00020\u00022\u0006\u0010)\u001a\u00020\u000fH\u0080\b¨\u0006*"}, m238d2 = {"commonClose", "", "Lokio/RealBufferedSink;", "commonEmit", "Lokio/BufferedSink;", "commonEmitCompleteSegments", "commonFlush", "commonTimeout", "Lokio/Timeout;", "commonToString", "", "commonWrite", "source", "", TypedValues.Cycle.S_WAVE_OFFSET, "", "byteCount", "Lokio/Buffer;", "", "byteString", "Lokio/ByteString;", "Lokio/Source;", "commonWriteAll", "commonWriteByte", "b", "commonWriteDecimalLong", "v", "commonWriteHexadecimalUnsignedLong", "commonWriteInt", "i", "commonWriteIntLe", "commonWriteLong", "commonWriteLongLe", "commonWriteShort", "s", "commonWriteShortLe", "commonWriteUtf8", TypedValues.Custom.S_STRING, "beginIndex", "endIndex", "commonWriteUtf8CodePoint", "codePoint", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class RealBufferedSinkKt {
|
||||
public static final void commonWrite(buffer commonWrite, Buffer source, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
if (!(!commonWrite.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWrite.bufferField.write(source, byteCount);
|
||||
commonWrite.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWrite(buffer commonWrite, ByteString byteString) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(byteString, "byteString");
|
||||
if (!(!commonWrite.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWrite.bufferField.write(byteString);
|
||||
return commonWrite.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWrite(buffer commonWrite, ByteString byteString, int offset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(byteString, "byteString");
|
||||
if (!(!commonWrite.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWrite.bufferField.write(byteString, offset, byteCount);
|
||||
return commonWrite.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteUtf8(buffer commonWriteUtf8, String string) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteUtf8, "$this$commonWriteUtf8");
|
||||
Intrinsics.checkNotNullParameter(string, "string");
|
||||
if (!(!commonWriteUtf8.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteUtf8.bufferField.writeUtf8(string);
|
||||
return commonWriteUtf8.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteUtf8(buffer commonWriteUtf8, String string, int beginIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteUtf8, "$this$commonWriteUtf8");
|
||||
Intrinsics.checkNotNullParameter(string, "string");
|
||||
if (!(!commonWriteUtf8.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteUtf8.bufferField.writeUtf8(string, beginIndex, endIndex);
|
||||
return commonWriteUtf8.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteUtf8CodePoint(buffer commonWriteUtf8CodePoint, int codePoint) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteUtf8CodePoint, "$this$commonWriteUtf8CodePoint");
|
||||
if (!(!commonWriteUtf8CodePoint.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteUtf8CodePoint.bufferField.writeUtf8CodePoint(codePoint);
|
||||
return commonWriteUtf8CodePoint.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWrite(buffer commonWrite, byte[] source) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
if (!(!commonWrite.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWrite.bufferField.write(source);
|
||||
return commonWrite.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWrite(buffer commonWrite, byte[] source, int offset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
if (!(!commonWrite.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWrite.bufferField.write(source, offset, byteCount);
|
||||
return commonWrite.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final long commonWriteAll(buffer commonWriteAll, Source source) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteAll, "$this$commonWriteAll");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
long totalBytesRead = 0;
|
||||
while (true) {
|
||||
long readCount = source.read(commonWriteAll.bufferField, 8192);
|
||||
if (readCount != -1) {
|
||||
totalBytesRead += readCount;
|
||||
commonWriteAll.emitCompleteSegments();
|
||||
} else {
|
||||
return totalBytesRead;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWrite(buffer commonWrite, Source source, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
long byteCount2 = byteCount;
|
||||
while (byteCount2 > 0) {
|
||||
long read = source.read(commonWrite.bufferField, byteCount2);
|
||||
if (read == -1) {
|
||||
throw new EOFException();
|
||||
}
|
||||
byteCount2 -= read;
|
||||
commonWrite.emitCompleteSegments();
|
||||
}
|
||||
return commonWrite;
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteByte(buffer commonWriteByte, int b) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteByte, "$this$commonWriteByte");
|
||||
if (!(!commonWriteByte.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteByte.bufferField.writeByte(b);
|
||||
return commonWriteByte.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteShort(buffer commonWriteShort, int s) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteShort, "$this$commonWriteShort");
|
||||
if (!(!commonWriteShort.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteShort.bufferField.writeShort(s);
|
||||
return commonWriteShort.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteShortLe(buffer commonWriteShortLe, int s) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteShortLe, "$this$commonWriteShortLe");
|
||||
if (!(!commonWriteShortLe.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteShortLe.bufferField.writeShortLe(s);
|
||||
return commonWriteShortLe.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteInt(buffer commonWriteInt, int i) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteInt, "$this$commonWriteInt");
|
||||
if (!(!commonWriteInt.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteInt.bufferField.writeInt(i);
|
||||
return commonWriteInt.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteIntLe(buffer commonWriteIntLe, int i) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteIntLe, "$this$commonWriteIntLe");
|
||||
if (!(!commonWriteIntLe.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteIntLe.bufferField.writeIntLe(i);
|
||||
return commonWriteIntLe.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteLong(buffer commonWriteLong, long v) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteLong, "$this$commonWriteLong");
|
||||
if (!(!commonWriteLong.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteLong.bufferField.writeLong(v);
|
||||
return commonWriteLong.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteLongLe(buffer commonWriteLongLe, long v) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteLongLe, "$this$commonWriteLongLe");
|
||||
if (!(!commonWriteLongLe.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteLongLe.bufferField.writeLongLe(v);
|
||||
return commonWriteLongLe.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteDecimalLong(buffer commonWriteDecimalLong, long v) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteDecimalLong, "$this$commonWriteDecimalLong");
|
||||
if (!(!commonWriteDecimalLong.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteDecimalLong.bufferField.writeDecimalLong(v);
|
||||
return commonWriteDecimalLong.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonWriteHexadecimalUnsignedLong(buffer commonWriteHexadecimalUnsignedLong, long v) {
|
||||
Intrinsics.checkNotNullParameter(commonWriteHexadecimalUnsignedLong, "$this$commonWriteHexadecimalUnsignedLong");
|
||||
if (!(!commonWriteHexadecimalUnsignedLong.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
commonWriteHexadecimalUnsignedLong.bufferField.writeHexadecimalUnsignedLong(v);
|
||||
return commonWriteHexadecimalUnsignedLong.emitCompleteSegments();
|
||||
}
|
||||
|
||||
public static final BufferedSink commonEmitCompleteSegments(buffer commonEmitCompleteSegments) {
|
||||
Intrinsics.checkNotNullParameter(commonEmitCompleteSegments, "$this$commonEmitCompleteSegments");
|
||||
if (!(!commonEmitCompleteSegments.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
long byteCount = commonEmitCompleteSegments.bufferField.completeSegmentByteCount();
|
||||
if (byteCount > 0) {
|
||||
commonEmitCompleteSegments.sink.write(commonEmitCompleteSegments.bufferField, byteCount);
|
||||
}
|
||||
return commonEmitCompleteSegments;
|
||||
}
|
||||
|
||||
public static final BufferedSink commonEmit(buffer commonEmit) {
|
||||
Intrinsics.checkNotNullParameter(commonEmit, "$this$commonEmit");
|
||||
if (!(!commonEmit.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
long byteCount = commonEmit.bufferField.size();
|
||||
if (byteCount > 0) {
|
||||
commonEmit.sink.write(commonEmit.bufferField, byteCount);
|
||||
}
|
||||
return commonEmit;
|
||||
}
|
||||
|
||||
public static final void commonFlush(buffer commonFlush) {
|
||||
Intrinsics.checkNotNullParameter(commonFlush, "$this$commonFlush");
|
||||
if (!(!commonFlush.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (commonFlush.bufferField.size() > 0) {
|
||||
commonFlush.sink.write(commonFlush.bufferField, commonFlush.bufferField.size());
|
||||
}
|
||||
commonFlush.sink.flush();
|
||||
}
|
||||
|
||||
public static final void commonClose(buffer commonClose) {
|
||||
Intrinsics.checkNotNullParameter(commonClose, "$this$commonClose");
|
||||
if (commonClose.closed) {
|
||||
return;
|
||||
}
|
||||
Throwable thrown = (Throwable) null;
|
||||
try {
|
||||
if (commonClose.bufferField.size() > 0) {
|
||||
commonClose.sink.write(commonClose.bufferField, commonClose.bufferField.size());
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
thrown = e;
|
||||
}
|
||||
try {
|
||||
commonClose.sink.close();
|
||||
} catch (Throwable e2) {
|
||||
if (thrown == null) {
|
||||
thrown = e2;
|
||||
}
|
||||
}
|
||||
commonClose.closed = true;
|
||||
if (thrown != null) {
|
||||
throw thrown;
|
||||
}
|
||||
}
|
||||
|
||||
public static final Timeout commonTimeout(buffer commonTimeout) {
|
||||
Intrinsics.checkNotNullParameter(commonTimeout, "$this$commonTimeout");
|
||||
return commonTimeout.sink.getTimeout();
|
||||
}
|
||||
|
||||
public static final String commonToString(buffer commonToString) {
|
||||
Intrinsics.checkNotNullParameter(commonToString, "$this$commonToString");
|
||||
return "buffer(" + commonToString.sink + ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,500 @@
|
||||
package okio.internal;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.EOFException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.LongCompanionObject;
|
||||
import kotlin.text.CharsKt;
|
||||
import okio.Buffer;
|
||||
import okio.BufferedSource;
|
||||
import okio.ByteString;
|
||||
import okio.Okio;
|
||||
import okio.PeekSource;
|
||||
import okio.Sink;
|
||||
import okio.Timeout;
|
||||
import okio.Util;
|
||||
import okio.buffer;
|
||||
|
||||
/* compiled from: RealBufferedSource.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000j\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\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\u0003\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\n\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\r\u0010\u0000\u001a\u00020\u0001*\u00020\u0002H\u0080\b\u001a\r\u0010\u0003\u001a\u00020\u0004*\u00020\u0002H\u0080\b\u001a%\u0010\u0005\u001a\u00020\u0006*\u00020\u00022\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\u00062\u0006\u0010\n\u001a\u00020\u0006H\u0080\b\u001a\u001d\u0010\u0005\u001a\u00020\u0006*\u00020\u00022\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\t\u001a\u00020\u0006H\u0080\b\u001a\u001d\u0010\r\u001a\u00020\u0006*\u00020\u00022\u0006\u0010\u000e\u001a\u00020\f2\u0006\u0010\t\u001a\u00020\u0006H\u0080\b\u001a\r\u0010\u000f\u001a\u00020\u0010*\u00020\u0002H\u0080\b\u001a-\u0010\u0011\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u0012\u001a\u00020\u00062\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u0013\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0014H\u0080\b\u001a%\u0010\u0016\u001a\u00020\u0014*\u00020\u00022\u0006\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0012\u001a\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u0014H\u0080\b\u001a\u001d\u0010\u0016\u001a\u00020\u0006*\u00020\u00022\u0006\u0010\u0017\u001a\u00020\u00192\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\u0015\u0010\u001a\u001a\u00020\u0006*\u00020\u00022\u0006\u0010\u0017\u001a\u00020\u001bH\u0080\b\u001a\r\u0010\u001c\u001a\u00020\b*\u00020\u0002H\u0080\b\u001a\r\u0010\u001d\u001a\u00020\u0018*\u00020\u0002H\u0080\b\u001a\u0015\u0010\u001d\u001a\u00020\u0018*\u00020\u00022\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\r\u0010\u001e\u001a\u00020\f*\u00020\u0002H\u0080\b\u001a\u0015\u0010\u001e\u001a\u00020\f*\u00020\u00022\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\r\u0010\u001f\u001a\u00020\u0006*\u00020\u0002H\u0080\b\u001a\u0015\u0010 \u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0017\u001a\u00020\u0018H\u0080\b\u001a\u001d\u0010 \u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0017\u001a\u00020\u00192\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\r\u0010!\u001a\u00020\u0006*\u00020\u0002H\u0080\b\u001a\r\u0010\"\u001a\u00020\u0014*\u00020\u0002H\u0080\b\u001a\r\u0010#\u001a\u00020\u0014*\u00020\u0002H\u0080\b\u001a\r\u0010$\u001a\u00020\u0006*\u00020\u0002H\u0080\b\u001a\r\u0010%\u001a\u00020\u0006*\u00020\u0002H\u0080\b\u001a\r\u0010&\u001a\u00020'*\u00020\u0002H\u0080\b\u001a\r\u0010(\u001a\u00020'*\u00020\u0002H\u0080\b\u001a\r\u0010)\u001a\u00020**\u00020\u0002H\u0080\b\u001a\u0015\u0010)\u001a\u00020**\u00020\u00022\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\r\u0010+\u001a\u00020\u0014*\u00020\u0002H\u0080\b\u001a\u000f\u0010,\u001a\u0004\u0018\u00010**\u00020\u0002H\u0080\b\u001a\u0015\u0010-\u001a\u00020**\u00020\u00022\u0006\u0010.\u001a\u00020\u0006H\u0080\b\u001a\u0015\u0010/\u001a\u00020\u0004*\u00020\u00022\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\u0015\u00100\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\u0015\u00101\u001a\u00020\u0014*\u00020\u00022\u0006\u00102\u001a\u000203H\u0080\b\u001a\u0015\u00104\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0015\u001a\u00020\u0006H\u0080\b\u001a\r\u00105\u001a\u000206*\u00020\u0002H\u0080\b\u001a\r\u00107\u001a\u00020**\u00020\u0002H\u0080\b¨\u00068"}, m238d2 = {"commonClose", "", "Lokio/RealBufferedSource;", "commonExhausted", "", "commonIndexOf", "", "b", "", "fromIndex", "toIndex", "bytes", "Lokio/ByteString;", "commonIndexOfElement", "targetBytes", "commonPeek", "Lokio/BufferedSource;", "commonRangeEquals", TypedValues.Cycle.S_WAVE_OFFSET, "bytesOffset", "", "byteCount", "commonRead", "sink", "", "Lokio/Buffer;", "commonReadAll", "Lokio/Sink;", "commonReadByte", "commonReadByteArray", "commonReadByteString", "commonReadDecimalLong", "commonReadFully", "commonReadHexadecimalUnsignedLong", "commonReadInt", "commonReadIntLe", "commonReadLong", "commonReadLongLe", "commonReadShort", "", "commonReadShortLe", "commonReadUtf8", "", "commonReadUtf8CodePoint", "commonReadUtf8Line", "commonReadUtf8LineStrict", "limit", "commonRequest", "commonRequire", "commonSelect", "options", "Lokio/Options;", "commonSkip", "commonTimeout", "Lokio/Timeout;", "commonToString", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class RealBufferedSourceKt {
|
||||
public static final long commonRead(buffer commonRead, Buffer sink, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRead, "$this$commonRead");
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
if (!(byteCount >= 0)) {
|
||||
throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString());
|
||||
}
|
||||
if (!(!commonRead.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (commonRead.bufferField.size() == 0) {
|
||||
long read = commonRead.source.read(commonRead.bufferField, 8192);
|
||||
if (read == -1) {
|
||||
return -1L;
|
||||
}
|
||||
}
|
||||
long toRead = Math.min(byteCount, commonRead.bufferField.size());
|
||||
return commonRead.bufferField.read(sink, toRead);
|
||||
}
|
||||
|
||||
public static final boolean commonExhausted(buffer commonExhausted) {
|
||||
Intrinsics.checkNotNullParameter(commonExhausted, "$this$commonExhausted");
|
||||
if (!commonExhausted.closed) {
|
||||
return commonExhausted.bufferField.exhausted() && commonExhausted.source.read(commonExhausted.bufferField, (long) 8192) == -1;
|
||||
}
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
|
||||
public static final void commonRequire(buffer commonRequire, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRequire, "$this$commonRequire");
|
||||
if (!commonRequire.request(byteCount)) {
|
||||
throw new EOFException();
|
||||
}
|
||||
}
|
||||
|
||||
public static final boolean commonRequest(buffer commonRequest, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRequest, "$this$commonRequest");
|
||||
if (!(byteCount >= 0)) {
|
||||
throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString());
|
||||
}
|
||||
if (!(!commonRequest.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
while (commonRequest.bufferField.size() < byteCount) {
|
||||
if (commonRequest.source.read(commonRequest.bufferField, 8192) == -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final byte commonReadByte(buffer commonReadByte) {
|
||||
Intrinsics.checkNotNullParameter(commonReadByte, "$this$commonReadByte");
|
||||
commonReadByte.require(1L);
|
||||
return commonReadByte.bufferField.readByte();
|
||||
}
|
||||
|
||||
public static final ByteString commonReadByteString(buffer commonReadByteString) {
|
||||
Intrinsics.checkNotNullParameter(commonReadByteString, "$this$commonReadByteString");
|
||||
commonReadByteString.bufferField.writeAll(commonReadByteString.source);
|
||||
return commonReadByteString.bufferField.readByteString();
|
||||
}
|
||||
|
||||
public static final ByteString commonReadByteString(buffer commonReadByteString, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonReadByteString, "$this$commonReadByteString");
|
||||
commonReadByteString.require(byteCount);
|
||||
return commonReadByteString.bufferField.readByteString(byteCount);
|
||||
}
|
||||
|
||||
/* JADX ERROR: JadxRuntimeException in pass: RegionMakerVisitor
|
||||
jadx.core.utils.exceptions.JadxRuntimeException: Failed to find switch 'out' block (already processed)
|
||||
at jadx.core.dex.visitors.regions.maker.SwitchRegionMaker.calcSwitchOut(SwitchRegionMaker.java:202)
|
||||
at jadx.core.dex.visitors.regions.maker.SwitchRegionMaker.process(SwitchRegionMaker.java:61)
|
||||
at jadx.core.dex.visitors.regions.maker.RegionMaker.traverse(RegionMaker.java:115)
|
||||
at jadx.core.dex.visitors.regions.maker.RegionMaker.makeRegion(RegionMaker.java:69)
|
||||
at jadx.core.dex.visitors.regions.maker.LoopRegionMaker.process(LoopRegionMaker.java:103)
|
||||
at jadx.core.dex.visitors.regions.maker.RegionMaker.traverse(RegionMaker.java:92)
|
||||
at jadx.core.dex.visitors.regions.maker.RegionMaker.makeRegion(RegionMaker.java:69)
|
||||
at jadx.core.dex.visitors.regions.maker.IfRegionMaker.process(IfRegionMaker.java:94)
|
||||
at jadx.core.dex.visitors.regions.maker.RegionMaker.traverse(RegionMaker.java:109)
|
||||
at jadx.core.dex.visitors.regions.maker.RegionMaker.makeRegion(RegionMaker.java:69)
|
||||
at jadx.core.dex.visitors.regions.maker.RegionMaker.makeMthRegion(RegionMaker.java:49)
|
||||
at jadx.core.dex.visitors.regions.RegionMakerVisitor.visit(RegionMakerVisitor.java:25)
|
||||
*/
|
||||
public static final int commonSelect(okio.buffer r8, okio.Options r9) {
|
||||
/*
|
||||
r0 = 0
|
||||
java.lang.String r1 = "$this$commonSelect"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r8, r1)
|
||||
java.lang.String r1 = "options"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r9, r1)
|
||||
boolean r1 = r8.closed
|
||||
r2 = 1
|
||||
r1 = r1 ^ r2
|
||||
if (r1 == 0) goto L48
|
||||
L11:
|
||||
L12:
|
||||
r1 = r8
|
||||
r3 = 0
|
||||
okio.Buffer r1 = r1.bufferField
|
||||
int r1 = okio.internal.BufferKt.selectPrefix(r1, r9, r2)
|
||||
r3 = -1
|
||||
switch(r1) {
|
||||
case -2: goto L32;
|
||||
case -1: goto L31;
|
||||
default: goto L1e;
|
||||
}
|
||||
L1e:
|
||||
okio.ByteString[] r2 = r9.getByteStrings()
|
||||
r2 = r2[r1]
|
||||
int r2 = r2.size()
|
||||
r3 = r8
|
||||
r4 = 0
|
||||
okio.Buffer r3 = r3.bufferField
|
||||
long r4 = (long) r2
|
||||
r3.skip(r4)
|
||||
return r1
|
||||
L31:
|
||||
return r3
|
||||
L32:
|
||||
okio.Source r4 = r8.source
|
||||
r5 = r8
|
||||
r6 = 0
|
||||
okio.Buffer r5 = r5.bufferField
|
||||
r6 = 8192(0x2000, float:1.148E-41)
|
||||
long r6 = (long) r6
|
||||
long r4 = r4.read(r5, r6)
|
||||
r6 = -1
|
||||
int r4 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1))
|
||||
if (r4 != 0) goto L46
|
||||
return r3
|
||||
L46:
|
||||
goto L11
|
||||
L48:
|
||||
r1 = 0
|
||||
java.lang.IllegalStateException r1 = new java.lang.IllegalStateException
|
||||
java.lang.String r2 = "closed"
|
||||
java.lang.String r2 = r2.toString()
|
||||
r1.<init>(r2)
|
||||
java.lang.Throwable r1 = (java.lang.Throwable) r1
|
||||
throw r1
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: okio.internal.RealBufferedSourceKt.commonSelect(okio.RealBufferedSource, okio.Options):int");
|
||||
}
|
||||
|
||||
public static final byte[] commonReadByteArray(buffer commonReadByteArray) {
|
||||
Intrinsics.checkNotNullParameter(commonReadByteArray, "$this$commonReadByteArray");
|
||||
commonReadByteArray.bufferField.writeAll(commonReadByteArray.source);
|
||||
return commonReadByteArray.bufferField.readByteArray();
|
||||
}
|
||||
|
||||
public static final byte[] commonReadByteArray(buffer commonReadByteArray, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonReadByteArray, "$this$commonReadByteArray");
|
||||
commonReadByteArray.require(byteCount);
|
||||
return commonReadByteArray.bufferField.readByteArray(byteCount);
|
||||
}
|
||||
|
||||
public static final void commonReadFully(buffer commonReadFully, byte[] sink) {
|
||||
Intrinsics.checkNotNullParameter(commonReadFully, "$this$commonReadFully");
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
try {
|
||||
commonReadFully.require(sink.length);
|
||||
commonReadFully.bufferField.readFully(sink);
|
||||
} catch (EOFException e) {
|
||||
int offset = 0;
|
||||
while (commonReadFully.bufferField.size() > 0) {
|
||||
int read = commonReadFully.bufferField.read(sink, offset, (int) commonReadFully.bufferField.size());
|
||||
if (read == -1) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
offset += read;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public static final int commonRead(buffer commonRead, byte[] sink, int offset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRead, "$this$commonRead");
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
Util.checkOffsetAndCount(sink.length, offset, byteCount);
|
||||
if (commonRead.bufferField.size() == 0) {
|
||||
long read = commonRead.source.read(commonRead.bufferField, 8192);
|
||||
if (read == -1) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
long b$iv = commonRead.bufferField.size();
|
||||
int toRead = (int) Math.min(byteCount, b$iv);
|
||||
return commonRead.bufferField.read(sink, offset, toRead);
|
||||
}
|
||||
|
||||
public static final void commonReadFully(buffer commonReadFully, Buffer sink, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonReadFully, "$this$commonReadFully");
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
try {
|
||||
commonReadFully.require(byteCount);
|
||||
commonReadFully.bufferField.readFully(sink, byteCount);
|
||||
} catch (EOFException e) {
|
||||
sink.writeAll(commonReadFully.bufferField);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public static final long commonReadAll(buffer commonReadAll, Sink sink) {
|
||||
Intrinsics.checkNotNullParameter(commonReadAll, "$this$commonReadAll");
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
long totalBytesWritten = 0;
|
||||
while (commonReadAll.source.read(commonReadAll.bufferField, 8192) != -1) {
|
||||
long emitByteCount = commonReadAll.bufferField.completeSegmentByteCount();
|
||||
if (emitByteCount > 0) {
|
||||
totalBytesWritten += emitByteCount;
|
||||
sink.write(commonReadAll.bufferField, emitByteCount);
|
||||
}
|
||||
}
|
||||
if (commonReadAll.bufferField.size() > 0) {
|
||||
long totalBytesWritten2 = totalBytesWritten + commonReadAll.bufferField.size();
|
||||
sink.write(commonReadAll.bufferField, commonReadAll.bufferField.size());
|
||||
return totalBytesWritten2;
|
||||
}
|
||||
return totalBytesWritten;
|
||||
}
|
||||
|
||||
public static final String commonReadUtf8(buffer commonReadUtf8) {
|
||||
Intrinsics.checkNotNullParameter(commonReadUtf8, "$this$commonReadUtf8");
|
||||
commonReadUtf8.bufferField.writeAll(commonReadUtf8.source);
|
||||
return commonReadUtf8.bufferField.readUtf8();
|
||||
}
|
||||
|
||||
public static final String commonReadUtf8(buffer commonReadUtf8, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonReadUtf8, "$this$commonReadUtf8");
|
||||
commonReadUtf8.require(byteCount);
|
||||
return commonReadUtf8.bufferField.readUtf8(byteCount);
|
||||
}
|
||||
|
||||
public static final String commonReadUtf8Line(buffer commonReadUtf8Line) {
|
||||
Intrinsics.checkNotNullParameter(commonReadUtf8Line, "$this$commonReadUtf8Line");
|
||||
long newline = commonReadUtf8Line.indexOf((byte) 10);
|
||||
if (newline != -1) {
|
||||
return BufferKt.readUtf8Line(commonReadUtf8Line.bufferField, newline);
|
||||
}
|
||||
if (commonReadUtf8Line.bufferField.size() != 0) {
|
||||
return commonReadUtf8Line.readUtf8(commonReadUtf8Line.bufferField.size());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final String commonReadUtf8LineStrict(buffer commonReadUtf8LineStrict, long limit) {
|
||||
Intrinsics.checkNotNullParameter(commonReadUtf8LineStrict, "$this$commonReadUtf8LineStrict");
|
||||
if (!(limit >= 0)) {
|
||||
throw new IllegalArgumentException(("limit < 0: " + limit).toString());
|
||||
}
|
||||
long scanLength = limit == LongCompanionObject.MAX_VALUE ? Long.MAX_VALUE : limit + 1;
|
||||
byte b = (byte) 10;
|
||||
long newline = commonReadUtf8LineStrict.indexOf(b, 0L, scanLength);
|
||||
if (newline != -1) {
|
||||
return BufferKt.readUtf8Line(commonReadUtf8LineStrict.bufferField, newline);
|
||||
}
|
||||
if (scanLength < LongCompanionObject.MAX_VALUE && commonReadUtf8LineStrict.request(scanLength) && commonReadUtf8LineStrict.bufferField.getByte(scanLength - 1) == ((byte) 13) && commonReadUtf8LineStrict.request(1 + scanLength) && commonReadUtf8LineStrict.bufferField.getByte(scanLength) == b) {
|
||||
return BufferKt.readUtf8Line(commonReadUtf8LineStrict.bufferField, scanLength);
|
||||
}
|
||||
Buffer data = new Buffer();
|
||||
Buffer buffer = commonReadUtf8LineStrict.bufferField;
|
||||
long b$iv = commonReadUtf8LineStrict.bufferField.size();
|
||||
buffer.copyTo(data, 0L, Math.min(32, b$iv));
|
||||
throw new EOFException("\\n not found: limit=" + Math.min(commonReadUtf8LineStrict.bufferField.size(), limit) + " content=" + data.readByteString().hex() + "…");
|
||||
}
|
||||
|
||||
public static final int commonReadUtf8CodePoint(buffer commonReadUtf8CodePoint) {
|
||||
Intrinsics.checkNotNullParameter(commonReadUtf8CodePoint, "$this$commonReadUtf8CodePoint");
|
||||
commonReadUtf8CodePoint.require(1L);
|
||||
int b0 = commonReadUtf8CodePoint.bufferField.getByte(0L);
|
||||
if ((b0 & 224) == 192) {
|
||||
commonReadUtf8CodePoint.require(2L);
|
||||
} else if ((b0 & 240) == 224) {
|
||||
commonReadUtf8CodePoint.require(3L);
|
||||
} else if ((b0 & 248) == 240) {
|
||||
commonReadUtf8CodePoint.require(4L);
|
||||
}
|
||||
return commonReadUtf8CodePoint.bufferField.readUtf8CodePoint();
|
||||
}
|
||||
|
||||
public static final short commonReadShort(buffer commonReadShort) {
|
||||
Intrinsics.checkNotNullParameter(commonReadShort, "$this$commonReadShort");
|
||||
commonReadShort.require(2L);
|
||||
return commonReadShort.bufferField.readShort();
|
||||
}
|
||||
|
||||
public static final short commonReadShortLe(buffer commonReadShortLe) {
|
||||
Intrinsics.checkNotNullParameter(commonReadShortLe, "$this$commonReadShortLe");
|
||||
commonReadShortLe.require(2L);
|
||||
return commonReadShortLe.bufferField.readShortLe();
|
||||
}
|
||||
|
||||
public static final int commonReadInt(buffer commonReadInt) {
|
||||
Intrinsics.checkNotNullParameter(commonReadInt, "$this$commonReadInt");
|
||||
commonReadInt.require(4L);
|
||||
return commonReadInt.bufferField.readInt();
|
||||
}
|
||||
|
||||
public static final int commonReadIntLe(buffer commonReadIntLe) {
|
||||
Intrinsics.checkNotNullParameter(commonReadIntLe, "$this$commonReadIntLe");
|
||||
commonReadIntLe.require(4L);
|
||||
return commonReadIntLe.bufferField.readIntLe();
|
||||
}
|
||||
|
||||
public static final long commonReadLong(buffer commonReadLong) {
|
||||
Intrinsics.checkNotNullParameter(commonReadLong, "$this$commonReadLong");
|
||||
commonReadLong.require(8L);
|
||||
return commonReadLong.bufferField.readLong();
|
||||
}
|
||||
|
||||
public static final long commonReadLongLe(buffer commonReadLongLe) {
|
||||
Intrinsics.checkNotNullParameter(commonReadLongLe, "$this$commonReadLongLe");
|
||||
commonReadLongLe.require(8L);
|
||||
return commonReadLongLe.bufferField.readLongLe();
|
||||
}
|
||||
|
||||
public static final long commonReadDecimalLong(buffer commonReadDecimalLong) {
|
||||
Intrinsics.checkNotNullParameter(commonReadDecimalLong, "$this$commonReadDecimalLong");
|
||||
commonReadDecimalLong.require(1L);
|
||||
for (long pos = 0; commonReadDecimalLong.request(pos + 1); pos++) {
|
||||
byte b = commonReadDecimalLong.bufferField.getByte(pos);
|
||||
if ((b < ((byte) 48) || b > ((byte) 57)) && (pos != 0 || b != ((byte) 45))) {
|
||||
if (pos == 0) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Expected leading [0-9] or '-' character but was 0x");
|
||||
String num = Integer.toString(b, CharsKt.checkRadix(CharsKt.checkRadix(16)));
|
||||
Intrinsics.checkNotNullExpressionValue(num, "java.lang.Integer.toStri…(this, checkRadix(radix))");
|
||||
sb.append(num);
|
||||
throw new NumberFormatException(sb.toString());
|
||||
}
|
||||
return commonReadDecimalLong.bufferField.readDecimalLong();
|
||||
}
|
||||
}
|
||||
return commonReadDecimalLong.bufferField.readDecimalLong();
|
||||
}
|
||||
|
||||
public static final long commonReadHexadecimalUnsignedLong(buffer commonReadHexadecimalUnsignedLong) {
|
||||
Intrinsics.checkNotNullParameter(commonReadHexadecimalUnsignedLong, "$this$commonReadHexadecimalUnsignedLong");
|
||||
commonReadHexadecimalUnsignedLong.require(1L);
|
||||
for (int pos = 0; commonReadHexadecimalUnsignedLong.request(pos + 1); pos++) {
|
||||
byte b = commonReadHexadecimalUnsignedLong.bufferField.getByte(pos);
|
||||
if ((b < ((byte) 48) || b > ((byte) 57)) && ((b < ((byte) 97) || b > ((byte) 102)) && (b < ((byte) 65) || b > ((byte) 70)))) {
|
||||
if (pos == 0) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("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))");
|
||||
sb.append(num);
|
||||
throw new NumberFormatException(sb.toString());
|
||||
}
|
||||
return commonReadHexadecimalUnsignedLong.bufferField.readHexadecimalUnsignedLong();
|
||||
}
|
||||
}
|
||||
return commonReadHexadecimalUnsignedLong.bufferField.readHexadecimalUnsignedLong();
|
||||
}
|
||||
|
||||
public static final void commonSkip(buffer commonSkip, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonSkip, "$this$commonSkip");
|
||||
long byteCount2 = byteCount;
|
||||
if (!(!commonSkip.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
while (byteCount2 > 0) {
|
||||
if (commonSkip.bufferField.size() == 0 && commonSkip.source.read(commonSkip.bufferField, 8192) == -1) {
|
||||
throw new EOFException();
|
||||
}
|
||||
long toSkip = Math.min(byteCount2, commonSkip.bufferField.size());
|
||||
commonSkip.bufferField.skip(toSkip);
|
||||
byteCount2 -= toSkip;
|
||||
}
|
||||
}
|
||||
|
||||
public static final long commonIndexOf(buffer commonIndexOf, byte b, long fromIndex, long toIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonIndexOf, "$this$commonIndexOf");
|
||||
if (!(!commonIndexOf.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (0 <= fromIndex && toIndex >= fromIndex) {
|
||||
long fromIndex2 = fromIndex;
|
||||
while (fromIndex2 < toIndex) {
|
||||
long result = commonIndexOf.bufferField.indexOf(b, fromIndex2, toIndex);
|
||||
if (result != -1) {
|
||||
return result;
|
||||
}
|
||||
long lastBufferSize = commonIndexOf.bufferField.size();
|
||||
if (lastBufferSize >= toIndex || commonIndexOf.source.read(commonIndexOf.bufferField, 8192) == -1) {
|
||||
return -1L;
|
||||
}
|
||||
fromIndex2 = Math.max(fromIndex2, lastBufferSize);
|
||||
}
|
||||
return -1L;
|
||||
}
|
||||
throw new IllegalArgumentException(("fromIndex=" + fromIndex + " toIndex=" + toIndex).toString());
|
||||
}
|
||||
|
||||
public static final long commonIndexOf(buffer commonIndexOf, ByteString bytes, long fromIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonIndexOf, "$this$commonIndexOf");
|
||||
Intrinsics.checkNotNullParameter(bytes, "bytes");
|
||||
long fromIndex2 = fromIndex;
|
||||
if (!(!commonIndexOf.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
while (true) {
|
||||
long result = commonIndexOf.bufferField.indexOf(bytes, fromIndex2);
|
||||
if (result != -1) {
|
||||
return result;
|
||||
}
|
||||
long lastBufferSize = commonIndexOf.bufferField.size();
|
||||
if (commonIndexOf.source.read(commonIndexOf.bufferField, 8192) == -1) {
|
||||
return -1L;
|
||||
}
|
||||
fromIndex2 = Math.max(fromIndex2, (lastBufferSize - bytes.size()) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static final long commonIndexOfElement(buffer commonIndexOfElement, ByteString targetBytes, long fromIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonIndexOfElement, "$this$commonIndexOfElement");
|
||||
Intrinsics.checkNotNullParameter(targetBytes, "targetBytes");
|
||||
long fromIndex2 = fromIndex;
|
||||
if (!(!commonIndexOfElement.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
while (true) {
|
||||
long result = commonIndexOfElement.bufferField.indexOfElement(targetBytes, fromIndex2);
|
||||
if (result != -1) {
|
||||
return result;
|
||||
}
|
||||
long lastBufferSize = commonIndexOfElement.bufferField.size();
|
||||
if (commonIndexOfElement.source.read(commonIndexOfElement.bufferField, 8192) == -1) {
|
||||
return -1L;
|
||||
}
|
||||
fromIndex2 = Math.max(fromIndex2, lastBufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
public static final boolean commonRangeEquals(buffer commonRangeEquals, long offset, ByteString bytes, int bytesOffset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRangeEquals, "$this$commonRangeEquals");
|
||||
Intrinsics.checkNotNullParameter(bytes, "bytes");
|
||||
if (!(!commonRangeEquals.closed)) {
|
||||
throw new IllegalStateException("closed".toString());
|
||||
}
|
||||
if (offset < 0 || bytesOffset < 0 || byteCount < 0 || bytes.size() - bytesOffset < byteCount) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < byteCount; i++) {
|
||||
long bufferOffset = i + offset;
|
||||
if (!commonRangeEquals.request(1 + bufferOffset) || commonRangeEquals.bufferField.getByte(bufferOffset) != bytes.getByte(bytesOffset + i)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final BufferedSource commonPeek(buffer commonPeek) {
|
||||
Intrinsics.checkNotNullParameter(commonPeek, "$this$commonPeek");
|
||||
return Okio.buffer(new PeekSource(commonPeek));
|
||||
}
|
||||
|
||||
public static final void commonClose(buffer commonClose) {
|
||||
Intrinsics.checkNotNullParameter(commonClose, "$this$commonClose");
|
||||
if (commonClose.closed) {
|
||||
return;
|
||||
}
|
||||
commonClose.closed = true;
|
||||
commonClose.source.close();
|
||||
commonClose.bufferField.clear();
|
||||
}
|
||||
|
||||
public static final Timeout commonTimeout(buffer commonTimeout) {
|
||||
Intrinsics.checkNotNullParameter(commonTimeout, "$this$commonTimeout");
|
||||
return commonTimeout.source.getTimeout();
|
||||
}
|
||||
|
||||
public static final String commonToString(buffer commonToString) {
|
||||
Intrinsics.checkNotNullParameter(commonToString, "$this$commonToString");
|
||||
return "buffer(" + commonToString.source + ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
package okio.internal;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.functions.Function3;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import okio.Buffer;
|
||||
import okio.ByteString;
|
||||
import okio.Segment;
|
||||
import okio.SegmentedByteString;
|
||||
import okio.Util;
|
||||
|
||||
/* compiled from: SegmentedByteString.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000R\n\u0000\n\u0002\u0010\b\n\u0002\u0010\u0015\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0010\u0005\n\u0002\b\u0003\n\u0002\u0010\u0012\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u001a$\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u00012\u0006\u0010\u0004\u001a\u00020\u00012\u0006\u0010\u0005\u001a\u00020\u0001H\u0000\u001a\u0017\u0010\u0006\u001a\u00020\u0007*\u00020\b2\b\u0010\t\u001a\u0004\u0018\u00010\nH\u0080\b\u001a\r\u0010\u000b\u001a\u00020\u0001*\u00020\bH\u0080\b\u001a\r\u0010\f\u001a\u00020\u0001*\u00020\bH\u0080\b\u001a\u0015\u0010\r\u001a\u00020\u000e*\u00020\b2\u0006\u0010\u000f\u001a\u00020\u0001H\u0080\b\u001a-\u0010\u0010\u001a\u00020\u0007*\u00020\b2\u0006\u0010\u0011\u001a\u00020\u00012\u0006\u0010\t\u001a\u00020\u00122\u0006\u0010\u0013\u001a\u00020\u00012\u0006\u0010\u0014\u001a\u00020\u0001H\u0080\b\u001a-\u0010\u0010\u001a\u00020\u0007*\u00020\b2\u0006\u0010\u0011\u001a\u00020\u00012\u0006\u0010\t\u001a\u00020\u00152\u0006\u0010\u0013\u001a\u00020\u00012\u0006\u0010\u0014\u001a\u00020\u0001H\u0080\b\u001a\u001d\u0010\u0016\u001a\u00020\u0015*\u00020\b2\u0006\u0010\u0017\u001a\u00020\u00012\u0006\u0010\u0018\u001a\u00020\u0001H\u0080\b\u001a\r\u0010\u0019\u001a\u00020\u0012*\u00020\bH\u0080\b\u001a%\u0010\u001a\u001a\u00020\u001b*\u00020\b2\u0006\u0010\u001c\u001a\u00020\u001d2\u0006\u0010\u0011\u001a\u00020\u00012\u0006\u0010\u0014\u001a\u00020\u0001H\u0080\b\u001a]\u0010\u001e\u001a\u00020\u001b*\u00020\b2K\u0010\u001f\u001aG\u0012\u0013\u0012\u00110\u0012¢\u0006\f\b!\u0012\b\b\"\u0012\u0004\b\b(#\u0012\u0013\u0012\u00110\u0001¢\u0006\f\b!\u0012\b\b\"\u0012\u0004\b\b(\u0011\u0012\u0013\u0012\u00110\u0001¢\u0006\f\b!\u0012\b\b\"\u0012\u0004\b\b(\u0014\u0012\u0004\u0012\u00020\u001b0 H\u0080\bø\u0001\u0000\u001aj\u0010\u001e\u001a\u00020\u001b*\u00020\b2\u0006\u0010\u0017\u001a\u00020\u00012\u0006\u0010\u0018\u001a\u00020\u00012K\u0010\u001f\u001aG\u0012\u0013\u0012\u00110\u0012¢\u0006\f\b!\u0012\b\b\"\u0012\u0004\b\b(#\u0012\u0013\u0012\u00110\u0001¢\u0006\f\b!\u0012\b\b\"\u0012\u0004\b\b(\u0011\u0012\u0013\u0012\u00110\u0001¢\u0006\f\b!\u0012\b\b\"\u0012\u0004\b\b(\u0014\u0012\u0004\u0012\u00020\u001b0 H\u0082\b\u001a\u0014\u0010$\u001a\u00020\u0001*\u00020\b2\u0006\u0010\u000f\u001a\u00020\u0001H\u0000\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006%"}, m238d2 = {"binarySearch", "", "", "value", "fromIndex", "toIndex", "commonEquals", "", "Lokio/SegmentedByteString;", "other", "", "commonGetSize", "commonHashCode", "commonInternalGet", "", "pos", "commonRangeEquals", TypedValues.Cycle.S_WAVE_OFFSET, "", "otherOffset", "byteCount", "Lokio/ByteString;", "commonSubstring", "beginIndex", "endIndex", "commonToByteArray", "commonWrite", "", "buffer", "Lokio/Buffer;", "forEachSegment", "action", "Lkotlin/Function3;", "Lkotlin/ParameterName;", "name", "data", "segment", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class SegmentedByteStringKt {
|
||||
public static final int binarySearch(int[] binarySearch, int value, int fromIndex, int toIndex) {
|
||||
Intrinsics.checkNotNullParameter(binarySearch, "$this$binarySearch");
|
||||
int left = fromIndex;
|
||||
int right = toIndex - 1;
|
||||
while (left <= right) {
|
||||
int mid = (left + right) >>> 1;
|
||||
int midVal = binarySearch[mid];
|
||||
if (midVal < value) {
|
||||
left = mid + 1;
|
||||
} else {
|
||||
if (midVal <= value) {
|
||||
return mid;
|
||||
}
|
||||
right = mid - 1;
|
||||
}
|
||||
}
|
||||
return (-left) - 1;
|
||||
}
|
||||
|
||||
public static final int segment(SegmentedByteString segment, int pos) {
|
||||
Intrinsics.checkNotNullParameter(segment, "$this$segment");
|
||||
int i = binarySearch(segment.getDirectory(), pos + 1, 0, segment.getSegments().length);
|
||||
return i >= 0 ? i : ~i;
|
||||
}
|
||||
|
||||
public static final void forEachSegment(SegmentedByteString forEachSegment, Function3<? super byte[], ? super Integer, ? super Integer, Unit> action) {
|
||||
Intrinsics.checkNotNullParameter(forEachSegment, "$this$forEachSegment");
|
||||
Intrinsics.checkNotNullParameter(action, "action");
|
||||
int segmentCount = forEachSegment.getSegments().length;
|
||||
int pos = 0;
|
||||
for (int s = 0; s < segmentCount; s++) {
|
||||
int segmentPos = forEachSegment.getDirectory()[segmentCount + s];
|
||||
int nextSegmentOffset = forEachSegment.getDirectory()[s];
|
||||
action.invoke(forEachSegment.getSegments()[s], Integer.valueOf(segmentPos), Integer.valueOf(nextSegmentOffset - pos));
|
||||
pos = nextSegmentOffset;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final void forEachSegment(SegmentedByteString $this$forEachSegment, int beginIndex, int endIndex, Function3<? super byte[], ? super Integer, ? super Integer, Unit> function3) {
|
||||
int s = segment($this$forEachSegment, beginIndex);
|
||||
int pos = beginIndex;
|
||||
while (pos < endIndex) {
|
||||
int segmentOffset = s == 0 ? 0 : $this$forEachSegment.getDirectory()[s - 1];
|
||||
int segmentSize = $this$forEachSegment.getDirectory()[s] - segmentOffset;
|
||||
int segmentPos = $this$forEachSegment.getDirectory()[$this$forEachSegment.getSegments().length + s];
|
||||
int byteCount = Math.min(endIndex, segmentOffset + segmentSize) - pos;
|
||||
int offset = (pos - segmentOffset) + segmentPos;
|
||||
function3.invoke($this$forEachSegment.getSegments()[s], Integer.valueOf(offset), Integer.valueOf(byteCount));
|
||||
pos += byteCount;
|
||||
s++;
|
||||
}
|
||||
}
|
||||
|
||||
public static final ByteString commonSubstring(SegmentedByteString commonSubstring, int beginIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(commonSubstring, "$this$commonSubstring");
|
||||
if (!(beginIndex >= 0)) {
|
||||
throw new IllegalArgumentException(("beginIndex=" + beginIndex + " < 0").toString());
|
||||
}
|
||||
if (!(endIndex <= commonSubstring.size())) {
|
||||
throw new IllegalArgumentException(("endIndex=" + endIndex + " > length(" + commonSubstring.size() + ')').toString());
|
||||
}
|
||||
int subLen = endIndex - beginIndex;
|
||||
if (!(subLen >= 0)) {
|
||||
throw new IllegalArgumentException(("endIndex=" + endIndex + " < beginIndex=" + beginIndex).toString());
|
||||
}
|
||||
if (beginIndex == 0 && endIndex == commonSubstring.size()) {
|
||||
return commonSubstring;
|
||||
}
|
||||
if (beginIndex == endIndex) {
|
||||
return ByteString.EMPTY;
|
||||
}
|
||||
int beginSegment = segment(commonSubstring, beginIndex);
|
||||
int endSegment = segment(commonSubstring, endIndex - 1);
|
||||
byte[][] newSegments = (byte[][]) ArraysKt.copyOfRange(commonSubstring.getSegments(), beginSegment, endSegment + 1);
|
||||
int[] newDirectory = new int[newSegments.length * 2];
|
||||
int index = 0;
|
||||
if (beginSegment <= endSegment) {
|
||||
int s = beginSegment;
|
||||
while (true) {
|
||||
newDirectory[index] = Math.min(commonSubstring.getDirectory()[s] - beginIndex, subLen);
|
||||
int index2 = index + 1;
|
||||
newDirectory[index + newSegments.length] = commonSubstring.getDirectory()[commonSubstring.getSegments().length + s];
|
||||
if (s == endSegment) {
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
index = index2;
|
||||
}
|
||||
}
|
||||
int segmentOffset = beginSegment != 0 ? commonSubstring.getDirectory()[beginSegment - 1] : 0;
|
||||
int length = newSegments.length;
|
||||
newDirectory[length] = newDirectory[length] + (beginIndex - segmentOffset);
|
||||
return new SegmentedByteString(newSegments, newDirectory);
|
||||
}
|
||||
|
||||
public static final byte commonInternalGet(SegmentedByteString commonInternalGet, int pos) {
|
||||
Intrinsics.checkNotNullParameter(commonInternalGet, "$this$commonInternalGet");
|
||||
Util.checkOffsetAndCount(commonInternalGet.getDirectory()[commonInternalGet.getSegments().length - 1], pos, 1L);
|
||||
int segment = segment(commonInternalGet, pos);
|
||||
int segmentOffset = segment == 0 ? 0 : commonInternalGet.getDirectory()[segment - 1];
|
||||
int segmentPos = commonInternalGet.getDirectory()[commonInternalGet.getSegments().length + segment];
|
||||
return commonInternalGet.getSegments()[segment][(pos - segmentOffset) + segmentPos];
|
||||
}
|
||||
|
||||
public static final int commonGetSize(SegmentedByteString commonGetSize) {
|
||||
Intrinsics.checkNotNullParameter(commonGetSize, "$this$commonGetSize");
|
||||
return commonGetSize.getDirectory()[commonGetSize.getSegments().length - 1];
|
||||
}
|
||||
|
||||
public static final byte[] commonToByteArray(SegmentedByteString commonToByteArray) {
|
||||
Intrinsics.checkNotNullParameter(commonToByteArray, "$this$commonToByteArray");
|
||||
byte[] result = new byte[commonToByteArray.size()];
|
||||
int resultPos = 0;
|
||||
int segmentCount$iv = commonToByteArray.getSegments().length;
|
||||
int pos$iv = 0;
|
||||
for (int s$iv = 0; s$iv < segmentCount$iv; s$iv++) {
|
||||
int segmentPos$iv = commonToByteArray.getDirectory()[segmentCount$iv + s$iv];
|
||||
int nextSegmentOffset$iv = commonToByteArray.getDirectory()[s$iv];
|
||||
byte[] data = commonToByteArray.getSegments()[s$iv];
|
||||
int byteCount = nextSegmentOffset$iv - pos$iv;
|
||||
ArraysKt.copyInto(data, result, resultPos, segmentPos$iv, segmentPos$iv + byteCount);
|
||||
resultPos += byteCount;
|
||||
pos$iv = nextSegmentOffset$iv;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final void commonWrite(SegmentedByteString commonWrite, Buffer buffer, int offset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonWrite, "$this$commonWrite");
|
||||
Intrinsics.checkNotNullParameter(buffer, "buffer");
|
||||
int endIndex$iv = offset + byteCount;
|
||||
int s$iv = segment(commonWrite, offset);
|
||||
int pos$iv = offset;
|
||||
while (pos$iv < endIndex$iv) {
|
||||
int segmentOffset$iv = s$iv == 0 ? 0 : commonWrite.getDirectory()[s$iv - 1];
|
||||
int segmentSize$iv = commonWrite.getDirectory()[s$iv] - segmentOffset$iv;
|
||||
int segmentPos$iv = commonWrite.getDirectory()[commonWrite.getSegments().length + s$iv];
|
||||
int byteCount$iv = Math.min(endIndex$iv, segmentOffset$iv + segmentSize$iv) - pos$iv;
|
||||
int offset$iv = (pos$iv - segmentOffset$iv) + segmentPos$iv;
|
||||
byte[] data = commonWrite.getSegments()[s$iv];
|
||||
Segment segment = new Segment(data, offset$iv, offset$iv + byteCount$iv, true, false);
|
||||
if (buffer.head == null) {
|
||||
segment.prev = segment;
|
||||
segment.next = segment.prev;
|
||||
buffer.head = segment.next;
|
||||
} else {
|
||||
Segment segment2 = buffer.head;
|
||||
Intrinsics.checkNotNull(segment2);
|
||||
Segment segment3 = segment2.prev;
|
||||
Intrinsics.checkNotNull(segment3);
|
||||
segment3.push(segment);
|
||||
}
|
||||
pos$iv += byteCount$iv;
|
||||
s$iv++;
|
||||
}
|
||||
buffer.setSize$okio(buffer.size() + commonWrite.size());
|
||||
}
|
||||
|
||||
public static final boolean commonRangeEquals(SegmentedByteString commonRangeEquals, int offset, ByteString other, int otherOffset, int byteCount) {
|
||||
int $i$f$commonRangeEquals = 0;
|
||||
Intrinsics.checkNotNullParameter(commonRangeEquals, "$this$commonRangeEquals");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
if (offset >= 0 && offset <= commonRangeEquals.size() - byteCount) {
|
||||
int otherOffset2 = otherOffset;
|
||||
int endIndex$iv = offset + byteCount;
|
||||
int s$iv = segment(commonRangeEquals, offset);
|
||||
int pos$iv = offset;
|
||||
while (pos$iv < endIndex$iv) {
|
||||
int segmentOffset$iv = s$iv == 0 ? 0 : commonRangeEquals.getDirectory()[s$iv - 1];
|
||||
int segmentSize$iv = commonRangeEquals.getDirectory()[s$iv] - segmentOffset$iv;
|
||||
int segmentPos$iv = commonRangeEquals.getDirectory()[commonRangeEquals.getSegments().length + s$iv];
|
||||
int byteCount$iv = Math.min(endIndex$iv, segmentOffset$iv + segmentSize$iv) - pos$iv;
|
||||
int offset$iv = (pos$iv - segmentOffset$iv) + segmentPos$iv;
|
||||
byte[] data = commonRangeEquals.getSegments()[s$iv];
|
||||
int offset2 = $i$f$commonRangeEquals;
|
||||
if (!other.rangeEquals(otherOffset2, data, offset$iv, byteCount$iv)) {
|
||||
return false;
|
||||
}
|
||||
otherOffset2 += byteCount$iv;
|
||||
pos$iv += byteCount$iv;
|
||||
s$iv++;
|
||||
$i$f$commonRangeEquals = offset2;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final boolean commonRangeEquals(SegmentedByteString commonRangeEquals, int offset, byte[] other, int otherOffset, int byteCount) {
|
||||
Intrinsics.checkNotNullParameter(commonRangeEquals, "$this$commonRangeEquals");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
if (offset < 0 || offset > commonRangeEquals.size() - byteCount || otherOffset < 0 || otherOffset > other.length - byteCount) {
|
||||
return false;
|
||||
}
|
||||
int otherOffset2 = otherOffset;
|
||||
int endIndex$iv = offset + byteCount;
|
||||
int s$iv = segment(commonRangeEquals, offset);
|
||||
int pos$iv = offset;
|
||||
while (pos$iv < endIndex$iv) {
|
||||
int segmentOffset$iv = s$iv == 0 ? 0 : commonRangeEquals.getDirectory()[s$iv - 1];
|
||||
int segmentSize$iv = commonRangeEquals.getDirectory()[s$iv] - segmentOffset$iv;
|
||||
int segmentPos$iv = commonRangeEquals.getDirectory()[commonRangeEquals.getSegments().length + s$iv];
|
||||
int byteCount$iv = Math.min(endIndex$iv, segmentOffset$iv + segmentSize$iv) - pos$iv;
|
||||
int offset$iv = segmentPos$iv + (pos$iv - segmentOffset$iv);
|
||||
byte[] data = commonRangeEquals.getSegments()[s$iv];
|
||||
if (!Util.arrayRangeEquals(data, offset$iv, other, otherOffset2, byteCount$iv)) {
|
||||
return false;
|
||||
}
|
||||
otherOffset2 += byteCount$iv;
|
||||
pos$iv += byteCount$iv;
|
||||
s$iv++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static final boolean commonEquals(SegmentedByteString commonEquals, Object other) {
|
||||
Intrinsics.checkNotNullParameter(commonEquals, "$this$commonEquals");
|
||||
if (other == commonEquals) {
|
||||
return true;
|
||||
}
|
||||
if (other instanceof ByteString) {
|
||||
return ((ByteString) other).size() == commonEquals.size() && commonEquals.rangeEquals(0, (ByteString) other, 0, commonEquals.size());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final int commonHashCode(SegmentedByteString commonHashCode) {
|
||||
Intrinsics.checkNotNullParameter(commonHashCode, "$this$commonHashCode");
|
||||
int result = commonHashCode.getHashCode();
|
||||
if (result != 0) {
|
||||
return result;
|
||||
}
|
||||
int result2 = 1;
|
||||
int segmentCount$iv = commonHashCode.getSegments().length;
|
||||
int pos$iv = 0;
|
||||
for (int s$iv = 0; s$iv < segmentCount$iv; s$iv++) {
|
||||
int segmentPos$iv = commonHashCode.getDirectory()[segmentCount$iv + s$iv];
|
||||
int nextSegmentOffset$iv = commonHashCode.getDirectory()[s$iv];
|
||||
byte[] data = commonHashCode.getSegments()[s$iv];
|
||||
int byteCount = nextSegmentOffset$iv - pos$iv;
|
||||
int limit = segmentPos$iv + byteCount;
|
||||
for (int i = segmentPos$iv; i < limit; i++) {
|
||||
result2 = (result2 * 31) + data[i];
|
||||
}
|
||||
pos$iv = nextSegmentOffset$iv;
|
||||
}
|
||||
commonHashCode.setHashCode$okio(result2);
|
||||
return result2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,416 @@
|
||||
package okio.internal;
|
||||
|
||||
import com.google.common.base.Ascii;
|
||||
import java.util.Arrays;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import okio.Utf8;
|
||||
|
||||
/* compiled from: -Utf8.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u0000\u0016\n\u0000\n\u0002\u0010\u0012\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\u001a\n\u0010\u0000\u001a\u00020\u0001*\u00020\u0002\u001a\u001e\u0010\u0003\u001a\u00020\u0002*\u00020\u00012\b\b\u0002\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u0005¨\u0006\u0007"}, m238d2 = {"commonAsUtf8ToByteArray", "", "", "commonToUtf8String", "beginIndex", "", "endIndex", "okio"}, m239k = 2, m240mv = {1, 4, 0})
|
||||
/* loaded from: classes11.dex */
|
||||
public final class _Utf8Kt {
|
||||
public static /* synthetic */ String commonToUtf8String$default(byte[] bArr, int i, int i2, int i3, Object obj) {
|
||||
if ((i3 & 1) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
if ((i3 & 2) != 0) {
|
||||
i2 = bArr.length;
|
||||
}
|
||||
return commonToUtf8String(bArr, i, i2);
|
||||
}
|
||||
|
||||
public static final String commonToUtf8String(byte[] commonToUtf8String, int beginIndex, int endIndex) {
|
||||
int $i$f$processUtf16Chars;
|
||||
int length;
|
||||
int length2;
|
||||
int i;
|
||||
int length3;
|
||||
int length4;
|
||||
int length5;
|
||||
int length6;
|
||||
int i2;
|
||||
int length7;
|
||||
int length8;
|
||||
byte b1$iv$iv;
|
||||
Intrinsics.checkNotNullParameter(commonToUtf8String, "$this$commonToUtf8String");
|
||||
if (beginIndex < 0 || endIndex > commonToUtf8String.length || beginIndex > endIndex) {
|
||||
throw new ArrayIndexOutOfBoundsException("size=" + commonToUtf8String.length + " beginIndex=" + beginIndex + " endIndex=" + endIndex);
|
||||
}
|
||||
char[] chars = new char[endIndex - beginIndex];
|
||||
int length9 = 0;
|
||||
int $i$f$processUtf16Chars2 = 0;
|
||||
int index$iv = beginIndex;
|
||||
while (index$iv < endIndex) {
|
||||
byte b0$iv = commonToUtf8String[index$iv];
|
||||
if (b0$iv >= 0) {
|
||||
char c = (char) b0$iv;
|
||||
int length10 = length9 + 1;
|
||||
chars[length9] = c;
|
||||
index$iv++;
|
||||
while (index$iv < endIndex && commonToUtf8String[index$iv] >= 0) {
|
||||
int index$iv2 = index$iv + 1;
|
||||
char c2 = (char) commonToUtf8String[index$iv];
|
||||
chars[length10] = c2;
|
||||
index$iv = index$iv2;
|
||||
length10++;
|
||||
}
|
||||
$i$f$processUtf16Chars = $i$f$processUtf16Chars2;
|
||||
length9 = length10;
|
||||
} else {
|
||||
int other$iv$iv = b0$iv >> 5;
|
||||
if (other$iv$iv == -2) {
|
||||
if (endIndex <= index$iv + 1) {
|
||||
char c3 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
int length11 = length9 + 1;
|
||||
chars[length9] = c3;
|
||||
Unit unit = Unit.INSTANCE;
|
||||
length8 = length11;
|
||||
b1$iv$iv = 1;
|
||||
$i$f$processUtf16Chars = $i$f$processUtf16Chars2;
|
||||
} else {
|
||||
byte b0$iv$iv = commonToUtf8String[index$iv];
|
||||
byte b1$iv$iv2 = commonToUtf8String[index$iv + 1];
|
||||
if ((b1$iv$iv2 & 192) == 128) {
|
||||
int codePoint$iv$iv = (b1$iv$iv2 ^ 3968) ^ (b0$iv$iv << 6);
|
||||
if (codePoint$iv$iv < 128) {
|
||||
$i$f$processUtf16Chars = $i$f$processUtf16Chars2;
|
||||
char c4 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
length7 = length9 + 1;
|
||||
chars[length9] = c4;
|
||||
} else {
|
||||
$i$f$processUtf16Chars = $i$f$processUtf16Chars2;
|
||||
char c5 = (char) codePoint$iv$iv;
|
||||
length7 = length9 + 1;
|
||||
chars[length9] = c5;
|
||||
}
|
||||
Unit unit2 = Unit.INSTANCE;
|
||||
length8 = length7;
|
||||
b1$iv$iv = 2;
|
||||
} else {
|
||||
char c6 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
length8 = length9 + 1;
|
||||
chars[length9] = c6;
|
||||
Unit unit3 = Unit.INSTANCE;
|
||||
$i$f$processUtf16Chars = $i$f$processUtf16Chars2;
|
||||
b1$iv$iv = 1;
|
||||
}
|
||||
}
|
||||
index$iv += b1$iv$iv;
|
||||
length9 = length8;
|
||||
} else {
|
||||
$i$f$processUtf16Chars = $i$f$processUtf16Chars2;
|
||||
int other$iv$iv2 = b0$iv >> 4;
|
||||
if (other$iv$iv2 == -2) {
|
||||
if (endIndex <= index$iv + 2) {
|
||||
char c7 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
length6 = length9 + 1;
|
||||
chars[length9] = c7;
|
||||
Unit unit4 = Unit.INSTANCE;
|
||||
if (endIndex > index$iv + 1) {
|
||||
int byte$iv$iv$iv = commonToUtf8String[index$iv + 1];
|
||||
int other$iv$iv$iv$iv = 192 & byte$iv$iv$iv;
|
||||
if (other$iv$iv$iv$iv == 128) {
|
||||
i2 = 2;
|
||||
}
|
||||
}
|
||||
i2 = 1;
|
||||
} else {
|
||||
byte b0$iv$iv2 = commonToUtf8String[index$iv];
|
||||
byte b1$iv$iv3 = commonToUtf8String[index$iv + 1];
|
||||
if ((b1$iv$iv3 & 192) == 128) {
|
||||
int length12 = index$iv + 2;
|
||||
byte b2$iv$iv = commonToUtf8String[length12];
|
||||
if ((b2$iv$iv & 192) == 128) {
|
||||
int codePoint$iv$iv2 = (((-123008) ^ b2$iv$iv) ^ (b1$iv$iv3 << 6)) ^ (b0$iv$iv2 << Ascii.f159FF);
|
||||
if (codePoint$iv$iv2 < 2048) {
|
||||
char c8 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
length5 = length9 + 1;
|
||||
chars[length9] = c8;
|
||||
} else if (55296 <= codePoint$iv$iv2 && 57343 >= codePoint$iv$iv2) {
|
||||
char c9 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
length5 = length9 + 1;
|
||||
chars[length9] = c9;
|
||||
} else {
|
||||
char c10 = (char) codePoint$iv$iv2;
|
||||
length5 = length9 + 1;
|
||||
chars[length9] = c10;
|
||||
}
|
||||
Unit unit5 = Unit.INSTANCE;
|
||||
length6 = length5;
|
||||
i2 = 3;
|
||||
} else {
|
||||
char c11 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
int length13 = length9 + 1;
|
||||
chars[length9] = c11;
|
||||
Unit unit6 = Unit.INSTANCE;
|
||||
length6 = length13;
|
||||
i2 = 2;
|
||||
}
|
||||
} else {
|
||||
char c12 = (char) Utf8.REPLACEMENT_CODE_POINT;
|
||||
int length14 = length9 + 1;
|
||||
chars[length9] = c12;
|
||||
Unit unit7 = Unit.INSTANCE;
|
||||
length6 = length14;
|
||||
i2 = 1;
|
||||
}
|
||||
}
|
||||
index$iv += i2;
|
||||
length9 = length6;
|
||||
} else {
|
||||
int other$iv$iv3 = b0$iv >> 3;
|
||||
if (other$iv$iv3 == -2) {
|
||||
if (endIndex <= index$iv + 3) {
|
||||
if (65533 != 65533) {
|
||||
char c13 = (char) ((Utf8.REPLACEMENT_CODE_POINT >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length15 = length9 + 1;
|
||||
chars[length9] = c13;
|
||||
char c14 = (char) ((65533 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
length3 = length15 + 1;
|
||||
chars[length15] = c14;
|
||||
} else {
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length3 = length9 + 1;
|
||||
}
|
||||
Unit unit8 = Unit.INSTANCE;
|
||||
if (endIndex > index$iv + 1) {
|
||||
int byte$iv$iv$iv2 = commonToUtf8String[index$iv + 1];
|
||||
int other$iv$iv$iv$iv2 = 192 & byte$iv$iv$iv2;
|
||||
if (other$iv$iv$iv$iv2 == 128) {
|
||||
if (endIndex > index$iv + 2) {
|
||||
int byte$iv$iv$iv3 = commonToUtf8String[index$iv + 2];
|
||||
int other$iv$iv$iv$iv3 = 192 & byte$iv$iv$iv3;
|
||||
if (other$iv$iv$iv$iv3 == 128) {
|
||||
i = 3;
|
||||
}
|
||||
}
|
||||
i = 2;
|
||||
}
|
||||
}
|
||||
i = 1;
|
||||
} else {
|
||||
byte b0$iv$iv3 = commonToUtf8String[index$iv];
|
||||
byte b1$iv$iv4 = commonToUtf8String[index$iv + 1];
|
||||
if ((b1$iv$iv4 & 192) == 128) {
|
||||
byte b2$iv$iv2 = commonToUtf8String[index$iv + 2];
|
||||
if ((b2$iv$iv2 & 192) == 128) {
|
||||
int length16 = index$iv + 3;
|
||||
byte b3$iv$iv = commonToUtf8String[length16];
|
||||
if ((b3$iv$iv & 192) == 128) {
|
||||
int codePoint$iv$iv3 = (((3678080 ^ b3$iv$iv) ^ (b2$iv$iv2 << 6)) ^ (b1$iv$iv4 << Ascii.f159FF)) ^ (b0$iv$iv3 << Ascii.DC2);
|
||||
if (codePoint$iv$iv3 > 1114111) {
|
||||
if (65533 != 65533) {
|
||||
char c15 = (char) ((Utf8.REPLACEMENT_CODE_POINT >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length17 = length9 + 1;
|
||||
chars[length9] = c15;
|
||||
char c16 = (char) ((65533 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
length2 = length17 + 1;
|
||||
chars[length17] = c16;
|
||||
Unit unit9 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
} else {
|
||||
length = length9 + 1;
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length2 = length;
|
||||
Unit unit92 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
}
|
||||
} else if (55296 <= codePoint$iv$iv3 && 57343 >= codePoint$iv$iv3) {
|
||||
if (65533 != 65533) {
|
||||
char c17 = (char) ((Utf8.REPLACEMENT_CODE_POINT >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length18 = length9 + 1;
|
||||
chars[length9] = c17;
|
||||
char c18 = (char) ((65533 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
length2 = length18 + 1;
|
||||
chars[length18] = c18;
|
||||
Unit unit922 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
} else {
|
||||
length = length9 + 1;
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length2 = length;
|
||||
Unit unit9222 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
}
|
||||
} else if (codePoint$iv$iv3 < 65536) {
|
||||
if (65533 != 65533) {
|
||||
char c19 = (char) ((Utf8.REPLACEMENT_CODE_POINT >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length19 = length9 + 1;
|
||||
chars[length9] = c19;
|
||||
char c20 = (char) ((65533 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
length2 = length19 + 1;
|
||||
chars[length19] = c20;
|
||||
Unit unit92222 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
} else {
|
||||
length = length9 + 1;
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length2 = length;
|
||||
Unit unit922222 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
}
|
||||
} else if (codePoint$iv$iv3 != 65533) {
|
||||
char c21 = (char) ((codePoint$iv$iv3 >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length20 = length9 + 1;
|
||||
chars[length9] = c21;
|
||||
char c22 = (char) ((codePoint$iv$iv3 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
length2 = length20 + 1;
|
||||
chars[length20] = c22;
|
||||
Unit unit9222222 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
} else {
|
||||
length = length9 + 1;
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length2 = length;
|
||||
Unit unit92222222 = Unit.INSTANCE;
|
||||
i = 4;
|
||||
length3 = length2;
|
||||
}
|
||||
} else {
|
||||
if (65533 != 65533) {
|
||||
char c23 = (char) ((Utf8.REPLACEMENT_CODE_POINT >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length21 = length9 + 1;
|
||||
chars[length9] = c23;
|
||||
char c24 = (char) ((65533 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
length4 = length21 + 1;
|
||||
chars[length21] = c24;
|
||||
} else {
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length4 = length9 + 1;
|
||||
}
|
||||
Unit unit10 = Unit.INSTANCE;
|
||||
length3 = length4;
|
||||
i = 3;
|
||||
}
|
||||
} else {
|
||||
if (65533 != 65533) {
|
||||
char c25 = (char) ((Utf8.REPLACEMENT_CODE_POINT >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length22 = length9 + 1;
|
||||
chars[length9] = c25;
|
||||
char c26 = (char) ((65533 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
chars[length22] = c26;
|
||||
length3 = length22 + 1;
|
||||
} else {
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length3 = length9 + 1;
|
||||
}
|
||||
Unit unit11 = Unit.INSTANCE;
|
||||
i = 2;
|
||||
}
|
||||
} else {
|
||||
if (65533 != 65533) {
|
||||
char c27 = (char) ((Utf8.REPLACEMENT_CODE_POINT >>> 10) + Utf8.HIGH_SURROGATE_HEADER);
|
||||
int length23 = length9 + 1;
|
||||
chars[length9] = c27;
|
||||
char c28 = (char) ((65533 & 1023) + Utf8.LOG_SURROGATE_HEADER);
|
||||
length3 = length23 + 1;
|
||||
chars[length23] = c28;
|
||||
} else {
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
length3 = length9 + 1;
|
||||
}
|
||||
Unit unit12 = Unit.INSTANCE;
|
||||
i = 1;
|
||||
}
|
||||
}
|
||||
index$iv += i;
|
||||
length9 = length3;
|
||||
} else {
|
||||
chars[length9] = Utf8.REPLACEMENT_CHARACTER;
|
||||
index$iv++;
|
||||
length9++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$i$f$processUtf16Chars2 = $i$f$processUtf16Chars;
|
||||
}
|
||||
return new String(chars, 0, length9);
|
||||
}
|
||||
|
||||
public static final byte[] commonAsUtf8ToByteArray(String commonAsUtf8ToByteArray) {
|
||||
char charAt;
|
||||
Intrinsics.checkNotNullParameter(commonAsUtf8ToByteArray, "$this$commonAsUtf8ToByteArray");
|
||||
byte[] bytes = new byte[commonAsUtf8ToByteArray.length() * 4];
|
||||
int length = commonAsUtf8ToByteArray.length();
|
||||
for (int index = 0; index < length; index++) {
|
||||
char b0 = commonAsUtf8ToByteArray.charAt(index);
|
||||
if (Intrinsics.compare((int) b0, 128) >= 0) {
|
||||
int size = index;
|
||||
int endIndex$iv = commonAsUtf8ToByteArray.length();
|
||||
int index$iv = index;
|
||||
while (index$iv < endIndex$iv) {
|
||||
char c$iv = commonAsUtf8ToByteArray.charAt(index$iv);
|
||||
if (Intrinsics.compare((int) c$iv, 128) < 0) {
|
||||
byte c = (byte) c$iv;
|
||||
int size2 = size + 1;
|
||||
bytes[size] = c;
|
||||
index$iv++;
|
||||
while (index$iv < endIndex$iv && Intrinsics.compare((int) commonAsUtf8ToByteArray.charAt(index$iv), 128) < 0) {
|
||||
int index$iv2 = index$iv + 1;
|
||||
byte c2 = (byte) commonAsUtf8ToByteArray.charAt(index$iv);
|
||||
bytes[size2] = c2;
|
||||
index$iv = index$iv2;
|
||||
size2++;
|
||||
}
|
||||
size = size2;
|
||||
} else if (Intrinsics.compare((int) c$iv, 2048) < 0) {
|
||||
byte c3 = (byte) ((c$iv >> 6) | 192);
|
||||
int size3 = size + 1;
|
||||
bytes[size] = c3;
|
||||
byte c4 = (byte) ((c$iv & '?') | 128);
|
||||
bytes[size3] = c4;
|
||||
index$iv++;
|
||||
size = size3 + 1;
|
||||
} else if (55296 > c$iv || 57343 < c$iv) {
|
||||
byte c5 = (byte) ((c$iv >> '\f') | 224);
|
||||
int size4 = size + 1;
|
||||
bytes[size] = c5;
|
||||
byte c6 = (byte) (((c$iv >> 6) & 63) | 128);
|
||||
int size5 = size4 + 1;
|
||||
bytes[size4] = c6;
|
||||
byte c7 = (byte) ((c$iv & '?') | 128);
|
||||
bytes[size5] = c7;
|
||||
index$iv++;
|
||||
size = size5 + 1;
|
||||
} else if (Intrinsics.compare((int) c$iv, 56319) > 0 || endIndex$iv <= index$iv + 1 || 56320 > (charAt = commonAsUtf8ToByteArray.charAt(index$iv + 1)) || 57343 < charAt) {
|
||||
bytes[size] = Utf8.REPLACEMENT_BYTE;
|
||||
index$iv++;
|
||||
size++;
|
||||
} else {
|
||||
int codePoint$iv = ((c$iv << '\n') + commonAsUtf8ToByteArray.charAt(index$iv + 1)) - 56613888;
|
||||
byte c8 = (byte) ((codePoint$iv >> 18) | 240);
|
||||
int size6 = size + 1;
|
||||
bytes[size] = c8;
|
||||
byte c9 = (byte) (((codePoint$iv >> 12) & 63) | 128);
|
||||
int size7 = size6 + 1;
|
||||
bytes[size6] = c9;
|
||||
byte c10 = (byte) (((codePoint$iv >> 6) & 63) | 128);
|
||||
int size8 = size7 + 1;
|
||||
bytes[size7] = c10;
|
||||
byte c11 = (byte) ((codePoint$iv & 63) | 128);
|
||||
bytes[size8] = c11;
|
||||
index$iv += 2;
|
||||
size = size8 + 1;
|
||||
}
|
||||
}
|
||||
byte[] copyOf = Arrays.copyOf(bytes, size);
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, newSize)");
|
||||
return copyOf;
|
||||
}
|
||||
bytes[index] = (byte) b0;
|
||||
}
|
||||
byte[] copyOf2 = Arrays.copyOf(bytes, commonAsUtf8ToByteArray.length());
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf2, "java.util.Arrays.copyOf(this, newSize)");
|
||||
return copyOf2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package okio;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: JvmOkio.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\b\u0010\u0007\u001a\u00020\bH\u0016J\b\u0010\t\u001a\u00020\bH\u0016J\b\u0010\u0004\u001a\u00020\u0005H\u0016J\b\u0010\n\u001a\u00020\u000bH\u0016J\u0018\u0010\f\u001a\u00020\b2\u0006\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u0010H\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0011"}, m238d2 = {"Lokio/OutputStreamSink;", "Lokio/Sink;", "out", "Ljava/io/OutputStream;", "timeout", "Lokio/Timeout;", "(Ljava/io/OutputStream;Lokio/Timeout;)V", "close", "", "flush", "toString", "", "write", "source", "Lokio/Buffer;", "byteCount", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.OutputStreamSink, reason: from toString */
|
||||
/* loaded from: classes11.dex */
|
||||
final class sink implements Sink {
|
||||
private final OutputStream out;
|
||||
private final Timeout timeout;
|
||||
|
||||
public sink(OutputStream out, Timeout timeout) {
|
||||
Intrinsics.checkNotNullParameter(out, "out");
|
||||
Intrinsics.checkNotNullParameter(timeout, "timeout");
|
||||
this.out = out;
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
public void write(Buffer source, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Util.checkOffsetAndCount(source.size(), 0L, byteCount);
|
||||
long remaining = byteCount;
|
||||
while (remaining > 0) {
|
||||
this.timeout.throwIfReached();
|
||||
Segment head = source.head;
|
||||
Intrinsics.checkNotNull(head);
|
||||
int b$iv = (int) Math.min(remaining, head.limit - head.pos);
|
||||
this.out.write(head.data, head.pos, b$iv);
|
||||
head.pos += b$iv;
|
||||
remaining -= b$iv;
|
||||
source.setSize$okio(source.size() - b$iv);
|
||||
if (head.pos == head.limit) {
|
||||
source.head = head.pop();
|
||||
SegmentPool.recycle(head);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Flushable
|
||||
public void flush() {
|
||||
this.out.flush();
|
||||
}
|
||||
|
||||
@Override // okio.Sink, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
this.out.close();
|
||||
}
|
||||
|
||||
@Override // okio.Sink
|
||||
/* renamed from: timeout, reason: from getter */
|
||||
public Timeout getTimeout() {
|
||||
return this.timeout;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "sink(" + this.out + ')';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package okio;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: JvmOkio.kt */
|
||||
@Metadata(m236bv = {1, 0, 3}, m237d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006J\b\u0010\u0007\u001a\u00020\bH\u0016J\u0018\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\nH\u0016J\b\u0010\u0004\u001a\u00020\u0005H\u0016J\b\u0010\u000e\u001a\u00020\u000fH\u0016R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0010"}, m238d2 = {"Lokio/InputStreamSource;", "Lokio/Source;", "input", "Ljava/io/InputStream;", "timeout", "Lokio/Timeout;", "(Ljava/io/InputStream;Lokio/Timeout;)V", "close", "", "read", "", "sink", "Lokio/Buffer;", "byteCount", "toString", "", "okio"}, m239k = 1, m240mv = {1, 4, 0})
|
||||
/* renamed from: okio.InputStreamSource, reason: from toString */
|
||||
/* loaded from: classes11.dex */
|
||||
final class source implements Source {
|
||||
private final InputStream input;
|
||||
private final Timeout timeout;
|
||||
|
||||
public source(InputStream input, Timeout timeout) {
|
||||
Intrinsics.checkNotNullParameter(input, "input");
|
||||
Intrinsics.checkNotNullParameter(timeout, "timeout");
|
||||
this.input = input;
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
public long read(Buffer sink, long byteCount) {
|
||||
Intrinsics.checkNotNullParameter(sink, "sink");
|
||||
if (byteCount == 0) {
|
||||
return 0L;
|
||||
}
|
||||
if (!(byteCount >= 0)) {
|
||||
throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString());
|
||||
}
|
||||
try {
|
||||
this.timeout.throwIfReached();
|
||||
Segment tail = sink.writableSegment$okio(1);
|
||||
int b$iv = 8192 - tail.limit;
|
||||
int bytesRead = this.input.read(tail.data, tail.limit, (int) Math.min(byteCount, b$iv));
|
||||
if (bytesRead == -1) {
|
||||
if (tail.pos == tail.limit) {
|
||||
sink.head = tail.pop();
|
||||
SegmentPool.recycle(tail);
|
||||
return -1L;
|
||||
}
|
||||
return -1L;
|
||||
}
|
||||
tail.limit += bytesRead;
|
||||
sink.setSize$okio(sink.size() + bytesRead);
|
||||
return bytesRead;
|
||||
} catch (AssertionError e) {
|
||||
if (Okio.isAndroidGetsocknameError(e)) {
|
||||
throw new IOException(e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@Override // okio.Source, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
this.input.close();
|
||||
}
|
||||
|
||||
@Override // okio.Source
|
||||
/* renamed from: timeout, reason: from getter */
|
||||
public Timeout getTimeout() {
|
||||
return this.timeout;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "source(" + this.input + ')';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user