mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-13 01:17:17 +01:00
844 lines
40 KiB
Java
844 lines
40 KiB
Java
package okio;
|
|
|
|
import androidx.biometric.ErrorUtils$$ExternalSyntheticOutline0;
|
|
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
|
import androidx.core.app.AppLaunchChecker$$ExternalSyntheticOutline0;
|
|
import com.ReactNativeBlobUtil.ReactNativeBlobUtilConst;
|
|
import com.amazon.alexa.handsfree.protocols.sierracontentprovider.SierraContentProviderContract;
|
|
import com.amazon.alexa.redesign.view.container.CardStudioAgentSpaceMetrics;
|
|
import com.amazon.alexa.voice.tta.metrics.SimbaEventProcessor;
|
|
import com.amazonaws.services.s3.internal.Constants;
|
|
import com.dee.app.metrics.MetricsConstants;
|
|
import defpackage.a$$ExternalSyntheticOutline0;
|
|
import io.ktor.http.auth.HttpAuthHeader;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.ObjectInputStream;
|
|
import java.io.ObjectOutputStream;
|
|
import java.io.OutputStream;
|
|
import java.io.Serializable;
|
|
import java.lang.reflect.Field;
|
|
import java.nio.ByteBuffer;
|
|
import java.nio.charset.Charset;
|
|
import java.security.InvalidKeyException;
|
|
import java.security.MessageDigest;
|
|
import java.util.Arrays;
|
|
import javax.crypto.Mac;
|
|
import javax.crypto.spec.SecretKeySpec;
|
|
import kotlin.Deprecated;
|
|
import kotlin.DeprecationLevel;
|
|
import kotlin.Metadata;
|
|
import kotlin.ReplaceWith;
|
|
import kotlin.collections.ArraysKt;
|
|
import kotlin.jvm.JvmField;
|
|
import kotlin.jvm.JvmName;
|
|
import kotlin.jvm.JvmOverloads;
|
|
import kotlin.jvm.JvmStatic;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import kotlin.jvm.internal.SourceDebugExtension;
|
|
import kotlin.text.Charsets;
|
|
import kotlin.text.StringsKt;
|
|
import kotlin.text.StringsKt__StringsJVMKt;
|
|
import kotlinx.serialization.json.internal.AbstractJsonLexerKt;
|
|
import org.apache.commons.codec.digest.MessageDigestAlgorithms;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
import rx.Single$$ExternalSyntheticBUOutline0;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000r\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000f\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\b\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0005\n\u0002\b\u0019\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0016\u0018\u0000 ]2\u00020\u00012\b\u0012\u0004\u0012\u00020\u00000\u0002:\u0001]B\u000f\b\u0000\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\b\u0010\u0015\u001a\u00020\u0016H\u0016J\b\u0010\u0017\u001a\u00020\u0010H\u0016J\b\u0010\u0018\u001a\u00020\u0010H\u0016J\u0011\u0010\u0019\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u0000H\u0096\u0002J,\u0010\u001b\u001a\u00020\u001c2\b\b\u0002\u0010\u001d\u001a\u00020\t2\u0006\u0010\u001e\u001a\u00020\u00042\b\b\u0002\u0010\u001f\u001a\u00020\t2\u0006\u0010 \u001a\u00020\tH\u0016J\u0015\u0010!\u001a\u00020\u00002\u0006\u0010\"\u001a\u00020\u0010H\u0010¢\u0006\u0002\b#J\u000e\u0010$\u001a\u00020%2\u0006\u0010&\u001a\u00020\u0004J\u000e\u0010$\u001a\u00020%2\u0006\u0010&\u001a\u00020\u0000J\u0013\u0010'\u001a\u00020%2\b\u0010\u001a\u001a\u0004\u0018\u00010(H\u0096\u0002J\u0016\u0010)\u001a\u00020*2\u0006\u0010+\u001a\u00020\tH\u0087\u0002¢\u0006\u0002\b,J\u0015\u0010,\u001a\u00020*2\u0006\u0010+\u001a\u00020\tH\u0007¢\u0006\u0002\b-J\r\u0010.\u001a\u00020\tH\u0010¢\u0006\u0002\b/J\b\u0010\b\u001a\u00020\tH\u0016J\b\u00100\u001a\u00020\u0010H\u0016J\u001d\u00101\u001a\u00020\u00002\u0006\u0010\"\u001a\u00020\u00102\u0006\u00102\u001a\u00020\u0000H\u0010¢\u0006\u0002\b3J\u0010\u00104\u001a\u00020\u00002\u0006\u00102\u001a\u00020\u0000H\u0016J\u0010\u00105\u001a\u00020\u00002\u0006\u00102\u001a\u00020\u0000H\u0016J\u0010\u00106\u001a\u00020\u00002\u0006\u00102\u001a\u00020\u0000H\u0016J\u001a\u00107\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00042\b\b\u0002\u00108\u001a\u00020\tH\u0017J\u001a\u00107\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00002\b\b\u0002\u00108\u001a\u00020\tH\u0007J\r\u00109\u001a\u00020\u0004H\u0010¢\u0006\u0002\b:J\u0015\u0010;\u001a\u00020*2\u0006\u0010<\u001a\u00020\tH\u0010¢\u0006\u0002\b=J\u001a\u0010>\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00042\b\b\u0002\u00108\u001a\u00020\tH\u0017J\u001a\u0010>\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00002\b\b\u0002\u00108\u001a\u00020\tH\u0007J\u0006\u0010?\u001a\u00020\u0000J(\u0010@\u001a\u00020%2\u0006\u0010\u001d\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00042\u0006\u0010A\u001a\u00020\t2\u0006\u0010 \u001a\u00020\tH\u0016J(\u0010@\u001a\u00020%2\u0006\u0010\u001d\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00002\u0006\u0010A\u001a\u00020\t2\u0006\u0010 \u001a\u00020\tH\u0016J\u0010\u0010B\u001a\u00020\u001c2\u0006\u0010C\u001a\u00020DH\u0002J\u0006\u0010E\u001a\u00020\u0000J\u0006\u0010F\u001a\u00020\u0000J\u0006\u0010G\u001a\u00020\u0000J\r\u0010\u000e\u001a\u00020\tH\u0007¢\u0006\u0002\bHJ\u000e\u0010I\u001a\u00020%2\u0006\u0010J\u001a\u00020\u0004J\u000e\u0010I\u001a\u00020%2\u0006\u0010J\u001a\u00020\u0000J\u0010\u0010K\u001a\u00020\u00102\u0006\u0010L\u001a\u00020MH\u0016J\u001c\u0010N\u001a\u00020\u00002\b\b\u0002\u0010O\u001a\u00020\t2\b\b\u0002\u0010P\u001a\u00020\tH\u0017J\b\u0010Q\u001a\u00020\u0000H\u0016J\b\u0010R\u001a\u00020\u0000H\u0016J\b\u0010S\u001a\u00020\u0004H\u0016J\b\u0010T\u001a\u00020\u0010H\u0016J\b\u0010\u000f\u001a\u00020\u0010H\u0016J\u0010\u0010U\u001a\u00020\u001c2\u0006\u0010V\u001a\u00020WH\u0016J%\u0010U\u001a\u00020\u001c2\u0006\u0010X\u001a\u00020Y2\u0006\u0010\u001d\u001a\u00020\t2\u0006\u0010 \u001a\u00020\tH\u0010¢\u0006\u0002\bZJ\u0010\u0010[\u001a\u00020\u001c2\u0006\u0010V\u001a\u00020\\H\u0002R\u0014\u0010\u0003\u001a\u00020\u0004X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007R\u001a\u0010\b\u001a\u00020\tX\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\n\u0010\u000b\"\u0004\b\f\u0010\rR\u0011\u0010\u000e\u001a\u00020\t8G¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000bR\u001c\u0010\u000f\u001a\u0004\u0018\u00010\u0010X\u0080\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014¨\u0006^"}, d2 = {"Lokio/ByteString;", "Ljava/io/Serializable;", "", "data", "", "([B)V", "getData$okio", "()[B", "hashCode", "", "getHashCode$okio", "()I", "setHashCode$okio", "(I)V", "size", ReactNativeBlobUtilConst.RNFB_RESPONSE_UTF8, "", "getUtf8$okio", "()Ljava/lang/String;", "setUtf8$okio", "(Ljava/lang/String;)V", "asByteBuffer", "Ljava/nio/ByteBuffer;", ReactNativeBlobUtilConst.RNFB_RESPONSE_BASE64, "base64Url", "compareTo", CardStudioAgentSpaceMetrics.DimensionValue.SCHEME_OTHER, "copyInto", "", "offset", "target", "targetOffset", "byteCount", "digest", "algorithm", "digest$okio", "endsWith", "", "suffix", "equals", "", MetricsConstants.Method.CACHE_GET, "", "index", "getByte", "-deprecated_getByte", "getSize", "getSize$okio", "hex", "hmac", "key", "hmac$okio", "hmacSha1", "hmacSha256", "hmacSha512", "indexOf", "fromIndex", "internalArray", "internalArray$okio", "internalGet", "pos", "internalGet$okio", "lastIndexOf", SierraContentProviderContract.MD5_VALUE, "rangeEquals", "otherOffset", "readObject", "in", "Ljava/io/ObjectInputStream;", "sha1", "sha256", "sha512", "-deprecated_size", "startsWith", "prefix", TypedValues.Custom.S_STRING, HttpAuthHeader.Parameters.Charset, "Ljava/nio/charset/Charset;", "substring", "beginIndex", "endIndex", "toAsciiLowercase", "toAsciiUppercase", "toByteArray", "toString", "write", "out", "Ljava/io/OutputStream;", "buffer", "Lokio/Buffer;", "write$okio", "writeObject", "Ljava/io/ObjectOutputStream;", "Companion", "okio"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nByteString.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ByteString.kt\nokio/ByteString\n+ 2 ByteString.kt\nokio/internal/-ByteString\n+ 3 Util.kt\nokio/-SegmentedByteString\n+ 4 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,364:1\n43#2,7:365\n53#2:372\n56#2:373\n64#2,4:374\n68#2:379\n70#2:381\n76#2,23:382\n104#2,23:405\n131#2,2:428\n133#2,9:431\n145#2:440\n148#2:441\n151#2:442\n154#2:443\n162#2:444\n172#2,3:445\n171#2:448\n185#2,2:449\n190#2:451\n194#2:452\n198#2:453\n202#2:454\n206#2,7:455\n219#2:462\n223#2,8:463\n235#2,4:471\n244#2,5:475\n253#2,6:480\n259#2,9:487\n322#2,8:496\n131#2,2:504\n133#2,9:507\n333#2,9:516\n68#3:378\n74#3:380\n74#3:486\n1#4:430\n1#4:506\n*S KotlinDebug\n*F\n+ 1 ByteString.kt\nokio/ByteString\n*L\n66#1:365,7\n71#1:372\n108#1:373\n110#1:374,4\n110#1:379\n110#1:381\n112#1:382,23\n114#1:405,23\n118#1:428,2\n118#1:431,9\n120#1:440\n129#1:441\n131#1:442\n133#1:443\n152#1:444\n159#1:445,3\n159#1:448\n166#1:449,2\n168#1:451\n170#1:452\n172#1:453\n174#1:454\n180#1:455,7\n183#1:462\n186#1:463,8\n188#1:471,4\n190#1:475,5\n192#1:480,6\n192#1:487,9\n194#1:496,8\n194#1:504,2\n194#1:507,9\n194#1:516,9\n110#1:378\n110#1:380\n192#1:486\n118#1:430\n194#1:506\n*E\n"})
|
|
/* loaded from: classes10.dex */
|
|
public class ByteString implements Serializable, Comparable<ByteString> {
|
|
|
|
/* renamed from: Companion, reason: from kotlin metadata */
|
|
@NotNull
|
|
public static final Companion INSTANCE = new Companion(null);
|
|
|
|
@JvmField
|
|
@NotNull
|
|
public static final ByteString EMPTY = new ByteString(new byte[0]);
|
|
private static final long serialVersionUID = 1;
|
|
|
|
@NotNull
|
|
private final byte[] data;
|
|
private transient int hashCode;
|
|
|
|
@Nullable
|
|
private transient String utf8;
|
|
|
|
public ByteString(@NotNull byte[] bArr) {
|
|
bArr.getClass();
|
|
this.data = bArr;
|
|
}
|
|
|
|
public static /* synthetic */ void copyInto$default(ByteString byteString, int i, byte[] bArr, int i2, int i3, int i4, Object obj) {
|
|
if (obj != null) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: copyInto");
|
|
return;
|
|
}
|
|
if ((i4 & 1) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i4 & 4) != 0) {
|
|
i2 = 0;
|
|
}
|
|
byteString.copyInto(i, bArr, i2, i3);
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public static final ByteString decodeBase64(@NotNull String str) {
|
|
return INSTANCE.decodeBase64(str);
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public static final ByteString decodeHex(@NotNull String str) {
|
|
return INSTANCE.decodeHex(str);
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "encodeString")
|
|
@NotNull
|
|
public static final ByteString encodeString(@NotNull String str, @NotNull Charset charset) {
|
|
return INSTANCE.encodeString(str, charset);
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public static final ByteString encodeUtf8(@NotNull String str) {
|
|
return INSTANCE.encodeUtf8(str);
|
|
}
|
|
|
|
public static /* synthetic */ int indexOf$default(ByteString byteString, ByteString byteString2, int i, int i2, Object obj) {
|
|
if (obj != null) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: indexOf");
|
|
return 0;
|
|
}
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
return byteString.indexOf(byteString2, i);
|
|
}
|
|
|
|
public static /* synthetic */ int lastIndexOf$default(ByteString byteString, ByteString byteString2, int i, int i2, Object obj) {
|
|
if (obj != null) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: lastIndexOf");
|
|
return 0;
|
|
}
|
|
if ((i2 & 2) != 0) {
|
|
i = SegmentedByteString.getDEFAULT__ByteString_size();
|
|
}
|
|
return byteString.lastIndexOf(byteString2, i);
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "of")
|
|
@NotNull
|
|
public static final ByteString of(@NotNull ByteBuffer byteBuffer) {
|
|
return INSTANCE.of(byteBuffer);
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "read")
|
|
@NotNull
|
|
public static final ByteString read(@NotNull InputStream inputStream, int i) throws IOException {
|
|
return INSTANCE.read(inputStream, i);
|
|
}
|
|
|
|
private final void readObject(ObjectInputStream in) throws IOException {
|
|
ByteString read = INSTANCE.read(in, in.readInt());
|
|
Field declaredField = ByteString.class.getDeclaredField("data");
|
|
declaredField.setAccessible(true);
|
|
declaredField.set(this, read.data);
|
|
}
|
|
|
|
public static /* synthetic */ ByteString substring$default(ByteString byteString, int i, int i2, int i3, Object obj) {
|
|
if (obj != null) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: substring");
|
|
return null;
|
|
}
|
|
if ((i3 & 1) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i3 & 2) != 0) {
|
|
i2 = SegmentedByteString.getDEFAULT__ByteString_size();
|
|
}
|
|
return byteString.substring(i, i2);
|
|
}
|
|
|
|
private final void writeObject(ObjectOutputStream out) throws IOException {
|
|
out.writeInt(this.data.length);
|
|
out.write(this.data);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to operator function", replaceWith = @ReplaceWith(expression = "this[index]", imports = {}))
|
|
@JvmName(name = "-deprecated_getByte")
|
|
/* renamed from: -deprecated_getByte, reason: not valid java name */
|
|
public final byte m27184deprecated_getByte(int index) {
|
|
return getByte(index);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "size", imports = {}))
|
|
@JvmName(name = "-deprecated_size")
|
|
/* renamed from: -deprecated_size, reason: not valid java name */
|
|
public final int m27185deprecated_size() {
|
|
return size();
|
|
}
|
|
|
|
@NotNull
|
|
public ByteBuffer asByteBuffer() {
|
|
ByteBuffer asReadOnlyBuffer = ByteBuffer.wrap(this.data).asReadOnlyBuffer();
|
|
asReadOnlyBuffer.getClass();
|
|
return asReadOnlyBuffer;
|
|
}
|
|
|
|
@NotNull
|
|
public String base64() {
|
|
return Base64.encodeBase64$default(getData(), null, 1, null);
|
|
}
|
|
|
|
@NotNull
|
|
public String base64Url() {
|
|
return Base64.encodeBase64(getData(), Base64.getBASE64_URL_SAFE());
|
|
}
|
|
|
|
@Override // java.lang.Comparable
|
|
public int compareTo(@NotNull ByteString other) {
|
|
other.getClass();
|
|
int size = size();
|
|
int size2 = other.size();
|
|
int min = Math.min(size, size2);
|
|
for (int i = 0; i < min; i++) {
|
|
int i2 = getByte(i) & 255;
|
|
int i3 = other.getByte(i) & 255;
|
|
if (i2 != i3) {
|
|
return i2 < i3 ? -1 : 1;
|
|
}
|
|
}
|
|
if (size == size2) {
|
|
return 0;
|
|
}
|
|
return size < size2 ? -1 : 1;
|
|
}
|
|
|
|
public void copyInto(int offset, @NotNull byte[] target, int targetOffset, int byteCount) {
|
|
target.getClass();
|
|
ArraysKt.copyInto(getData(), target, targetOffset, offset, byteCount + offset);
|
|
}
|
|
|
|
@NotNull
|
|
public ByteString digest$okio(@NotNull String algorithm) {
|
|
algorithm.getClass();
|
|
MessageDigest messageDigest = MessageDigest.getInstance(algorithm);
|
|
messageDigest.update(this.data, 0, size());
|
|
byte[] digest = messageDigest.digest();
|
|
digest.getClass();
|
|
return new ByteString(digest);
|
|
}
|
|
|
|
public final boolean endsWith(@NotNull ByteString suffix) {
|
|
suffix.getClass();
|
|
return rangeEquals(size() - suffix.size(), suffix, 0, suffix.size());
|
|
}
|
|
|
|
public boolean equals(@Nullable Object other) {
|
|
if (other == this) {
|
|
return true;
|
|
}
|
|
if (other instanceof ByteString) {
|
|
ByteString byteString = (ByteString) other;
|
|
if (byteString.size() == getData().length && byteString.rangeEquals(0, getData(), 0, getData().length)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
@JvmName(name = "getByte")
|
|
public final byte getByte(int index) {
|
|
return internalGet$okio(index);
|
|
}
|
|
|
|
@NotNull
|
|
/* renamed from: getData$okio, reason: from getter */
|
|
public final byte[] getData() {
|
|
return this.data;
|
|
}
|
|
|
|
/* renamed from: getHashCode$okio, reason: from getter */
|
|
public final int getHashCode() {
|
|
return this.hashCode;
|
|
}
|
|
|
|
public int getSize$okio() {
|
|
return getData().length;
|
|
}
|
|
|
|
@Nullable
|
|
/* renamed from: getUtf8$okio, reason: from getter */
|
|
public final String getUtf8() {
|
|
return this.utf8;
|
|
}
|
|
|
|
public int hashCode() {
|
|
int hashCode = getHashCode();
|
|
if (hashCode != 0) {
|
|
return hashCode;
|
|
}
|
|
int hashCode2 = Arrays.hashCode(getData());
|
|
setHashCode$okio(hashCode2);
|
|
return hashCode2;
|
|
}
|
|
|
|
@NotNull
|
|
public String hex() {
|
|
char[] cArr = new char[getData().length * 2];
|
|
int i = 0;
|
|
for (byte b : getData()) {
|
|
int i2 = i + 1;
|
|
cArr[i] = okio.internal.ByteString.getHEX_DIGIT_CHARS()[(b >> 4) & 15];
|
|
i += 2;
|
|
cArr[i2] = okio.internal.ByteString.getHEX_DIGIT_CHARS()[b & 15];
|
|
}
|
|
return StringsKt.concatToString(cArr);
|
|
}
|
|
|
|
@NotNull
|
|
public ByteString hmac$okio(@NotNull String algorithm, @NotNull ByteString key) {
|
|
algorithm.getClass();
|
|
key.getClass();
|
|
try {
|
|
Mac mac = Mac.getInstance(algorithm);
|
|
mac.init(new SecretKeySpec(key.toByteArray(), algorithm));
|
|
byte[] doFinal = mac.doFinal(this.data);
|
|
doFinal.getClass();
|
|
return new ByteString(doFinal);
|
|
} catch (InvalidKeyException e) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1(e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
@NotNull
|
|
public ByteString hmacSha1(@NotNull ByteString key) {
|
|
key.getClass();
|
|
return hmac$okio(Constants.HMAC_SHA1_ALGORITHM, key);
|
|
}
|
|
|
|
@NotNull
|
|
public ByteString hmacSha256(@NotNull ByteString key) {
|
|
key.getClass();
|
|
return hmac$okio("HmacSHA256", key);
|
|
}
|
|
|
|
@NotNull
|
|
public ByteString hmacSha512(@NotNull ByteString key) {
|
|
key.getClass();
|
|
return hmac$okio("HmacSHA512", key);
|
|
}
|
|
|
|
@JvmOverloads
|
|
public int indexOf(@NotNull byte[] other, int fromIndex) {
|
|
other.getClass();
|
|
int length = getData().length - other.length;
|
|
int max = Math.max(fromIndex, 0);
|
|
if (max > length) {
|
|
return -1;
|
|
}
|
|
while (!SegmentedByteString.arrayRangeEquals(getData(), max, other, 0, other.length)) {
|
|
if (max == length) {
|
|
return -1;
|
|
}
|
|
max++;
|
|
}
|
|
return max;
|
|
}
|
|
|
|
@NotNull
|
|
public byte[] internalArray$okio() {
|
|
return getData();
|
|
}
|
|
|
|
public byte internalGet$okio(int pos) {
|
|
return getData()[pos];
|
|
}
|
|
|
|
@JvmOverloads
|
|
public int lastIndexOf(@NotNull byte[] other, int fromIndex) {
|
|
other.getClass();
|
|
for (int min = Math.min(SegmentedByteString.resolveDefaultParameter(this, fromIndex), getData().length - other.length); -1 < min; min--) {
|
|
if (SegmentedByteString.arrayRangeEquals(getData(), min, other, 0, other.length)) {
|
|
return min;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
@NotNull
|
|
public final ByteString md5() {
|
|
return digest$okio(MessageDigestAlgorithms.MD5);
|
|
}
|
|
|
|
public boolean rangeEquals(int offset, @NotNull byte[] other, int otherOffset, int byteCount) {
|
|
other.getClass();
|
|
return offset >= 0 && offset <= getData().length - byteCount && otherOffset >= 0 && otherOffset <= other.length - byteCount && SegmentedByteString.arrayRangeEquals(getData(), offset, other, otherOffset, byteCount);
|
|
}
|
|
|
|
public final void setHashCode$okio(int i) {
|
|
this.hashCode = i;
|
|
}
|
|
|
|
public final void setUtf8$okio(@Nullable String str) {
|
|
this.utf8 = str;
|
|
}
|
|
|
|
@NotNull
|
|
public final ByteString sha1() {
|
|
return digest$okio("SHA-1");
|
|
}
|
|
|
|
@NotNull
|
|
public final ByteString sha256() {
|
|
return digest$okio("SHA-256");
|
|
}
|
|
|
|
@NotNull
|
|
public final ByteString sha512() {
|
|
return digest$okio("SHA-512");
|
|
}
|
|
|
|
@JvmName(name = "size")
|
|
public final int size() {
|
|
return getSize$okio();
|
|
}
|
|
|
|
public final boolean startsWith(@NotNull ByteString prefix) {
|
|
prefix.getClass();
|
|
return rangeEquals(0, prefix, 0, prefix.size());
|
|
}
|
|
|
|
@NotNull
|
|
public String string(@NotNull Charset charset) {
|
|
charset.getClass();
|
|
return new String(this.data, charset);
|
|
}
|
|
|
|
@JvmOverloads
|
|
@NotNull
|
|
public ByteString substring(int beginIndex, int endIndex) {
|
|
int resolveDefaultParameter = SegmentedByteString.resolveDefaultParameter(this, endIndex);
|
|
if (beginIndex < 0) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("beginIndex < 0");
|
|
return null;
|
|
}
|
|
if (resolveDefaultParameter > getData().length) {
|
|
Path$$ExternalSyntheticBUOutline0.m((Object) ErrorUtils$$ExternalSyntheticOutline0.m(new StringBuilder("endIndex > length("), getData().length, ')'));
|
|
return null;
|
|
}
|
|
if (resolveDefaultParameter - beginIndex >= 0) {
|
|
return (beginIndex == 0 && resolveDefaultParameter == getData().length) ? this : new ByteString(ArraysKt.copyOfRange(getData(), beginIndex, resolveDefaultParameter));
|
|
}
|
|
Single$$ExternalSyntheticBUOutline0.m$3("endIndex < beginIndex");
|
|
return null;
|
|
}
|
|
|
|
@NotNull
|
|
public ByteString toAsciiLowercase() {
|
|
for (int i = 0; i < getData().length; i++) {
|
|
byte b = getData()[i];
|
|
if (b >= 65 && b <= 90) {
|
|
byte[] data = getData();
|
|
byte[] copyOf = Arrays.copyOf(data, data.length);
|
|
copyOf[i] = (byte) (b + 32);
|
|
for (int i2 = i + 1; i2 < copyOf.length; i2++) {
|
|
byte b2 = copyOf[i2];
|
|
if (b2 >= 65 && b2 <= 90) {
|
|
copyOf[i2] = (byte) (b2 + 32);
|
|
}
|
|
}
|
|
return new ByteString(copyOf);
|
|
}
|
|
}
|
|
return this;
|
|
}
|
|
|
|
@NotNull
|
|
public ByteString toAsciiUppercase() {
|
|
for (int i = 0; i < getData().length; i++) {
|
|
byte b = getData()[i];
|
|
if (b >= 97 && b <= 122) {
|
|
byte[] data = getData();
|
|
byte[] copyOf = Arrays.copyOf(data, data.length);
|
|
copyOf[i] = (byte) (b - 32);
|
|
for (int i2 = i + 1; i2 < copyOf.length; i2++) {
|
|
byte b2 = copyOf[i2];
|
|
if (b2 >= 97 && b2 <= 122) {
|
|
copyOf[i2] = (byte) (b2 - 32);
|
|
}
|
|
}
|
|
return new ByteString(copyOf);
|
|
}
|
|
}
|
|
return this;
|
|
}
|
|
|
|
@NotNull
|
|
public byte[] toByteArray() {
|
|
byte[] data = getData();
|
|
return Arrays.copyOf(data, data.length);
|
|
}
|
|
|
|
@NotNull
|
|
public String toString() {
|
|
String replace$default;
|
|
String replace$default2;
|
|
String replace$default3;
|
|
if (getData().length == 0) {
|
|
return "[size=0]";
|
|
}
|
|
int codePointIndexToCharIndex = okio.internal.ByteString.codePointIndexToCharIndex(getData(), 64);
|
|
if (codePointIndexToCharIndex != -1) {
|
|
String utf8 = utf8();
|
|
replace$default = StringsKt__StringsJVMKt.replace$default(utf8.substring(0, codePointIndexToCharIndex), "\\", "\\\\", false, 4, (Object) null);
|
|
replace$default2 = StringsKt__StringsJVMKt.replace$default(replace$default, "\n", "\\n", false, 4, (Object) null);
|
|
replace$default3 = StringsKt__StringsJVMKt.replace$default(replace$default2, StringUtils.CR, "\\r", false, 4, (Object) null);
|
|
if (codePointIndexToCharIndex >= utf8.length()) {
|
|
return AppLaunchChecker$$ExternalSyntheticOutline0.m(AbstractJsonLexerKt.END_LIST, "[text=", replace$default3);
|
|
}
|
|
return "[size=" + getData().length + " text=" + replace$default3 + "…]";
|
|
}
|
|
if (getData().length <= 64) {
|
|
return "[hex=" + hex() + AbstractJsonLexerKt.END_LIST;
|
|
}
|
|
StringBuilder sb = new StringBuilder("[size=");
|
|
sb.append(getData().length);
|
|
sb.append(" hex=");
|
|
int resolveDefaultParameter = SegmentedByteString.resolveDefaultParameter(this, 64);
|
|
if (resolveDefaultParameter > getData().length) {
|
|
Path$$ExternalSyntheticBUOutline0.m((Object) ErrorUtils$$ExternalSyntheticOutline0.m(new StringBuilder("endIndex > length("), getData().length, ')'));
|
|
return null;
|
|
}
|
|
if (resolveDefaultParameter < 0) {
|
|
Single$$ExternalSyntheticBUOutline0.m$3("endIndex < beginIndex");
|
|
return null;
|
|
}
|
|
if (resolveDefaultParameter != getData().length) {
|
|
this = new ByteString(ArraysKt.copyOfRange(getData(), 0, resolveDefaultParameter));
|
|
}
|
|
sb.append(this.hex());
|
|
sb.append("…]");
|
|
return sb.toString();
|
|
}
|
|
|
|
@NotNull
|
|
public String utf8() {
|
|
String utf8 = getUtf8();
|
|
if (utf8 != null) {
|
|
return utf8;
|
|
}
|
|
String utf8String = _JvmPlatformKt.toUtf8String(internalArray$okio());
|
|
setUtf8$okio(utf8String);
|
|
return utf8String;
|
|
}
|
|
|
|
public void write(@NotNull OutputStream out) throws IOException {
|
|
out.getClass();
|
|
out.write(this.data);
|
|
}
|
|
|
|
public void write$okio(@NotNull Buffer buffer, int offset, int byteCount) {
|
|
buffer.getClass();
|
|
okio.internal.ByteString.commonWrite(this, buffer, offset, byteCount);
|
|
}
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Metadata(d1 = {"\u0000N\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\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0002\u0010\u0005\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0017\u0010\u0007\u001a\u0004\u0018\u00010\u00042\u0006\u0010\b\u001a\u00020\tH\u0007¢\u0006\u0002\b\nJ\u0015\u0010\u000b\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\tH\u0007¢\u0006\u0002\b\fJ\u001d\u0010\r\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\u000e\u001a\u00020\u000fH\u0007¢\u0006\u0002\b\u0010J\u0015\u0010\u0011\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\tH\u0007¢\u0006\u0002\b\u0012J\u0015\u0010\u0013\u001a\u00020\u00042\u0006\u0010\u0014\u001a\u00020\u0015H\u0007¢\u0006\u0002\b\u0016J\u0014\u0010\u0013\u001a\u00020\u00042\n\u0010\u0017\u001a\u00020\u0018\"\u00020\u0019H\u0007J%\u0010\u0013\u001a\u00020\u00042\u0006\u0010\u001a\u001a\u00020\u00182\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001cH\u0007¢\u0006\u0002\b\u0016J\u001d\u0010\u001e\u001a\u00020\u00042\u0006\u0010\u001f\u001a\u00020 2\u0006\u0010\u001d\u001a\u00020\u001cH\u0007¢\u0006\u0002\b!J\u000e\u0010\u0007\u001a\u0004\u0018\u00010\u0004*\u00020\tH\u0007J\f\u0010\u000b\u001a\u00020\u0004*\u00020\tH\u0007J\u001b\u0010\"\u001a\u00020\u0004*\u00020\t2\b\b\u0002\u0010\u000e\u001a\u00020\u000fH\u0007¢\u0006\u0002\b\rJ\f\u0010\u0011\u001a\u00020\u0004*\u00020\tH\u0007J\u0019\u0010#\u001a\u00020\u0004*\u00020 2\u0006\u0010\u001d\u001a\u00020\u001cH\u0007¢\u0006\u0002\b\u001eJ\u0011\u0010$\u001a\u00020\u0004*\u00020\u0015H\u0007¢\u0006\u0002\b\u0013J%\u0010$\u001a\u00020\u0004*\u00020\u00182\b\b\u0002\u0010\u001b\u001a\u00020\u001c2\b\b\u0002\u0010\u001d\u001a\u00020\u001cH\u0007¢\u0006\u0002\b\u0013R\u0010\u0010\u0003\u001a\u00020\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082T¢\u0006\u0002\n\u0000¨\u0006%"}, d2 = {"Lokio/ByteString$Companion;", "", "()V", SimbaEventProcessor.SOURCE_EMPTY, "Lokio/ByteString;", "serialVersionUID", "", "decodeBase64", TypedValues.Custom.S_STRING, "", "-deprecated_decodeBase64", "decodeHex", "-deprecated_decodeHex", "encodeString", HttpAuthHeader.Parameters.Charset, "Ljava/nio/charset/Charset;", "-deprecated_encodeString", "encodeUtf8", "-deprecated_encodeUtf8", "of", "buffer", "Ljava/nio/ByteBuffer;", "-deprecated_of", "data", "", "", "array", "offset", "", "byteCount", "read", "inputstream", "Ljava/io/InputStream;", "-deprecated_read", "encode", "readByteString", "toByteString", "okio"}, k = 1, mv = {1, 9, 0}, xi = 48)
|
|
@SourceDebugExtension({"SMAP\nByteString.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ByteString.kt\nokio/ByteString$Companion\n+ 2 ByteString.kt\nokio/internal/-ByteString\n+ 3 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,364:1\n271#2:365\n275#2,3:366\n282#2,3:369\n289#2,2:372\n295#2:374\n297#2,7:376\n1#3:375\n1#3:383\n*S KotlinDebug\n*F\n+ 1 ByteString.kt\nokio/ByteString$Companion\n*L\n234#1:365\n239#1:366,3\n251#1:369,3\n259#1:372,2\n262#1:374\n262#1:376,7\n262#1:375\n*E\n"})
|
|
public static final class Companion {
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public static /* synthetic */ ByteString encodeString$default(Companion companion, String str, Charset charset, int i, Object obj) {
|
|
if ((i & 1) != 0) {
|
|
charset = Charsets.UTF_8;
|
|
}
|
|
return companion.encodeString(str, charset);
|
|
}
|
|
|
|
public static /* synthetic */ ByteString of$default(Companion companion, byte[] bArr, int i, int i2, int i3, Object obj) {
|
|
if ((i3 & 1) != 0) {
|
|
i = 0;
|
|
}
|
|
if ((i3 & 2) != 0) {
|
|
i2 = SegmentedByteString.getDEFAULT__ByteString_size();
|
|
}
|
|
return companion.of(bArr, i, i2);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.decodeBase64()", imports = {"okio.ByteString.Companion.decodeBase64"}))
|
|
@JvmName(name = "-deprecated_decodeBase64")
|
|
@Nullable
|
|
/* renamed from: -deprecated_decodeBase64, reason: not valid java name */
|
|
public final ByteString m27186deprecated_decodeBase64(@NotNull String string) {
|
|
string.getClass();
|
|
return decodeBase64(string);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.decodeHex()", imports = {"okio.ByteString.Companion.decodeHex"}))
|
|
@JvmName(name = "-deprecated_decodeHex")
|
|
@NotNull
|
|
/* renamed from: -deprecated_decodeHex, reason: not valid java name */
|
|
public final ByteString m27187deprecated_decodeHex(@NotNull String string) {
|
|
string.getClass();
|
|
return decodeHex(string);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.encode(charset)", imports = {"okio.ByteString.Companion.encode"}))
|
|
@JvmName(name = "-deprecated_encodeString")
|
|
@NotNull
|
|
/* renamed from: -deprecated_encodeString, reason: not valid java name */
|
|
public final ByteString m27188deprecated_encodeString(@NotNull String string, @NotNull Charset charset) {
|
|
string.getClass();
|
|
charset.getClass();
|
|
return encodeString(string, charset);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.encodeUtf8()", imports = {"okio.ByteString.Companion.encodeUtf8"}))
|
|
@JvmName(name = "-deprecated_encodeUtf8")
|
|
@NotNull
|
|
/* renamed from: -deprecated_encodeUtf8, reason: not valid java name */
|
|
public final ByteString m27189deprecated_encodeUtf8(@NotNull String string) {
|
|
string.getClass();
|
|
return encodeUtf8(string);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "buffer.toByteString()", imports = {"okio.ByteString.Companion.toByteString"}))
|
|
@JvmName(name = "-deprecated_of")
|
|
@NotNull
|
|
/* renamed from: -deprecated_of, reason: not valid java name */
|
|
public final ByteString m27190deprecated_of(@NotNull ByteBuffer buffer) {
|
|
buffer.getClass();
|
|
return of(buffer);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "inputstream.readByteString(byteCount)", imports = {"okio.ByteString.Companion.readByteString"}))
|
|
@JvmName(name = "-deprecated_read")
|
|
@NotNull
|
|
/* renamed from: -deprecated_read, reason: not valid java name */
|
|
public final ByteString m27192deprecated_read(@NotNull InputStream inputstream, int byteCount) {
|
|
inputstream.getClass();
|
|
return read(inputstream, byteCount);
|
|
}
|
|
|
|
@JvmStatic
|
|
@Nullable
|
|
public final ByteString decodeBase64(@NotNull String str) {
|
|
str.getClass();
|
|
byte[] decodeBase64ToArray = Base64.decodeBase64ToArray(str);
|
|
if (decodeBase64ToArray != null) {
|
|
return new ByteString(decodeBase64ToArray);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public final ByteString decodeHex(@NotNull String str) {
|
|
str.getClass();
|
|
if (str.length() % 2 != 0) {
|
|
Path$$ExternalSyntheticBUOutline0.m((Object) "Unexpected hex string: ".concat(str));
|
|
return null;
|
|
}
|
|
int length = str.length() / 2;
|
|
byte[] bArr = new byte[length];
|
|
for (int i = 0; i < length; i++) {
|
|
int i2 = i * 2;
|
|
bArr[i] = (byte) (okio.internal.ByteString.decodeHexDigit(str.charAt(i2 + 1)) + (okio.internal.ByteString.decodeHexDigit(str.charAt(i2)) << 4));
|
|
}
|
|
return new ByteString(bArr);
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "encodeString")
|
|
@NotNull
|
|
public final ByteString encodeString(@NotNull String str, @NotNull Charset charset) {
|
|
str.getClass();
|
|
charset.getClass();
|
|
byte[] bytes = str.getBytes(charset);
|
|
bytes.getClass();
|
|
return new ByteString(bytes);
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public final ByteString encodeUtf8(@NotNull String str) {
|
|
str.getClass();
|
|
ByteString byteString = new ByteString(_JvmPlatformKt.asUtf8ToByteArray(str));
|
|
byteString.setUtf8$okio(str);
|
|
return byteString;
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "of")
|
|
@NotNull
|
|
public final ByteString of(@NotNull byte[] bArr, int i, int i2) {
|
|
bArr.getClass();
|
|
int resolveDefaultParameter = SegmentedByteString.resolveDefaultParameter(bArr, i2);
|
|
SegmentedByteString.checkOffsetAndCount(bArr.length, i, resolveDefaultParameter);
|
|
return new ByteString(ArraysKt.copyOfRange(bArr, i, resolveDefaultParameter + i));
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "read")
|
|
@NotNull
|
|
public final ByteString read(@NotNull InputStream inputStream, int i) throws IOException {
|
|
inputStream.getClass();
|
|
if (i < 0) {
|
|
Path$$ExternalSyntheticBUOutline0.m((Object) a$$ExternalSyntheticOutline0.m(i, "byteCount < 0: "));
|
|
return null;
|
|
}
|
|
byte[] bArr = new byte[i];
|
|
int i2 = 0;
|
|
while (i2 < i) {
|
|
int read = inputStream.read(bArr, i2, i - i2);
|
|
if (read == -1) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$3();
|
|
return null;
|
|
}
|
|
i2 += read;
|
|
}
|
|
return new ByteString(bArr);
|
|
}
|
|
|
|
private Companion() {
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "array.toByteString(offset, byteCount)", imports = {"okio.ByteString.Companion.toByteString"}))
|
|
@JvmName(name = "-deprecated_of")
|
|
@NotNull
|
|
/* renamed from: -deprecated_of, reason: not valid java name */
|
|
public final ByteString m27191deprecated_of(@NotNull byte[] array, int offset, int byteCount) {
|
|
array.getClass();
|
|
return of(array, offset, byteCount);
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public final ByteString of(@NotNull byte... data) {
|
|
data.getClass();
|
|
return new ByteString(Arrays.copyOf(data, data.length));
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "of")
|
|
@NotNull
|
|
public final ByteString of(@NotNull ByteBuffer byteBuffer) {
|
|
byteBuffer.getClass();
|
|
byte[] bArr = new byte[byteBuffer.remaining()];
|
|
byteBuffer.get(bArr);
|
|
return new ByteString(bArr);
|
|
}
|
|
}
|
|
|
|
@JvmStatic
|
|
@NotNull
|
|
public static final ByteString of(@NotNull byte... bArr) {
|
|
return INSTANCE.of(bArr);
|
|
}
|
|
|
|
@JvmStatic
|
|
@JvmName(name = "of")
|
|
@NotNull
|
|
public static final ByteString of(@NotNull byte[] bArr, int i, int i2) {
|
|
return INSTANCE.of(bArr, i, i2);
|
|
}
|
|
|
|
public final boolean startsWith(@NotNull byte[] prefix) {
|
|
prefix.getClass();
|
|
return rangeEquals(0, prefix, 0, prefix.length);
|
|
}
|
|
|
|
public static /* synthetic */ int indexOf$default(ByteString byteString, byte[] bArr, int i, int i2, Object obj) {
|
|
if (obj != null) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: indexOf");
|
|
return 0;
|
|
}
|
|
if ((i2 & 2) != 0) {
|
|
i = 0;
|
|
}
|
|
return byteString.indexOf(bArr, i);
|
|
}
|
|
|
|
public static /* synthetic */ int lastIndexOf$default(ByteString byteString, byte[] bArr, int i, int i2, Object obj) {
|
|
if (obj != null) {
|
|
Buffer$$ExternalSyntheticBUOutline0.m$1("Super calls with default arguments not supported in this target, function: lastIndexOf");
|
|
return 0;
|
|
}
|
|
if ((i2 & 2) != 0) {
|
|
i = SegmentedByteString.getDEFAULT__ByteString_size();
|
|
}
|
|
return byteString.lastIndexOf(bArr, i);
|
|
}
|
|
|
|
public final boolean endsWith(@NotNull byte[] suffix) {
|
|
suffix.getClass();
|
|
return rangeEquals(size() - suffix.length, suffix, 0, suffix.length);
|
|
}
|
|
|
|
public boolean rangeEquals(int offset, @NotNull ByteString other, int otherOffset, int byteCount) {
|
|
other.getClass();
|
|
return other.rangeEquals(otherOffset, getData(), offset, byteCount);
|
|
}
|
|
|
|
@JvmOverloads
|
|
public final int indexOf(@NotNull byte[] bArr) {
|
|
bArr.getClass();
|
|
return indexOf$default(this, bArr, 0, 2, (Object) null);
|
|
}
|
|
|
|
@JvmOverloads
|
|
public final int indexOf(@NotNull ByteString other, int fromIndex) {
|
|
other.getClass();
|
|
return indexOf(other.internalArray$okio(), fromIndex);
|
|
}
|
|
|
|
@JvmOverloads
|
|
public final int indexOf(@NotNull ByteString byteString) {
|
|
byteString.getClass();
|
|
return indexOf$default(this, byteString, 0, 2, (Object) null);
|
|
}
|
|
|
|
@JvmOverloads
|
|
public final int lastIndexOf(@NotNull byte[] bArr) {
|
|
bArr.getClass();
|
|
return lastIndexOf$default(this, bArr, 0, 2, (Object) null);
|
|
}
|
|
|
|
@JvmOverloads
|
|
public final int lastIndexOf(@NotNull ByteString other, int fromIndex) {
|
|
other.getClass();
|
|
return lastIndexOf(other.internalArray$okio(), fromIndex);
|
|
}
|
|
|
|
@JvmOverloads
|
|
public final int lastIndexOf(@NotNull ByteString byteString) {
|
|
byteString.getClass();
|
|
return lastIndexOf$default(this, byteString, 0, 2, (Object) null);
|
|
}
|
|
|
|
@JvmOverloads
|
|
@NotNull
|
|
public final ByteString substring(int i) {
|
|
return substring$default(this, i, 0, 2, null);
|
|
}
|
|
|
|
@JvmOverloads
|
|
@NotNull
|
|
public final ByteString substring() {
|
|
return substring$default(this, 0, 0, 3, null);
|
|
}
|
|
}
|