content: package okio;
  
  import androidx.constraintlayout.core.motion.utils.TypedValues;
  import java.io.EOFException;
  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.UByte;
  import kotlin.collections.ArraysKt;
  import kotlin.jvm.JvmStatic;
  import kotlin.jvm.internal.DefaultConstructorMarker;
  import kotlin.jvm.internal.Intrinsics;
  import kotlin.text.Charsets;
  import kotlin.text.StringsKt;
  import mt.Log1F380D;
  import okio.internal.ByteStringKt;
  
  @Metadata(bv = {1, 0, 3}, d1 = {"\u0000p\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\b\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0005\n\u0002\b\u001a\n\u0002\u0010\u0002\n\u0000\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 Z2\u00020\u00012\b\u0012\u0004\u0012\u00020\u00000\u0002:\u0001ZB\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\u0002J\u0015\u0010\u001b\u001a\u00020\u00002\u0006\u0010\u001c\u001a\u00020\u0010H\u0010¢\u0006\u0002\b\u001dJ\u000e\u0010\u001e\u001a\u00020\u001f2\u0006\u0010 \u001a\u00020\u0004J\u000e\u0010\u001e\u001a\u00020\u001f2\u0006\u0010 \u001a\u00020\u0000J\u0013\u0010!\u001a\u00020\u001f2\b\u0010\u001a\u001a\u0004\u0018\u00010\"H\u0002J\u0016\u0010#\u001a\u00020$2\u0006\u0010%\u001a\u00020\tH\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\u0010*\u001a\u00020\u0010H\u0016J\u001d\u0010+\u001a\u00020\u00002\u0006\u0010\u001c\u001a\u00020\u00102\u0006\u0010,\u001a\u00020\u0000H\u0010¢\u0006\u0002\b-J\u0010\u0010.\u001a\u00020\u00002\u0006\u0010,\u001a\u00020\u0000H\u0016J\u0010\u0010/\u001a\u00020\u00002\u0006\u0010,\u001a\u00020\u0000H\u0016J\u0010\u00100\u001a\u00020\u00002\u0006\u0010,\u001a\u00020\u0000H\u0016J\u001a\u00101\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00042\b\b\u0002\u00102\u001a\u00020\tH\u0017J\u001a\u00101\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00002\b\b\u0002\u00102\u001a\u00020\tH\u0007J\r\u00103\u001a\u00020\u0004H\u0010¢\u0006\u0002\b4J\u0015\u00105\u001a\u00020$2\u0006\u00106\u001a\u00020\tH\u0010¢\u0006\u0002\b7J\u001a\u00108\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00042\b\b\u0002\u00102\u001a\u00020\tH\u0017J\u001a\u00108\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00002\b\b\u0002\u00102\u001a\u00020\tH\u0007J\b\u00109\u001a\u00020\u0000H\u0016J(\u0010:\u001a\u00020\u001f2\u0006\u0010;\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00042\u0006\u0010<\u001a\u00020\t2\u0006\u0010=\u001a\u00020\tH\u0016J(\u0010:\u001a\u00020\u001f2\u0006\u0010;\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\u00002\u0006\u0010<\u001a\u00020\t2\u0006\u0010=\u001a\u00020\tH\u0016J\u0010\u0010>\u001a\u00020?2\u0006\u0010@\u001a\u00020AH\u0002J\b\u0010B\u001a\u00020\u0000H\u0016J\b\u0010C\u001a\u00020\u0000H\u0016J\b\u0010D\u001a\u00020\u0000H\u0016J\r\u0010\u000e\u001a\u00020\tH\u0007¢\u0006\u0002\bEJ\u000e\u0010F\u001a\u00020\u001f2\u0006\u0010G\u001a\u00020\u0004J\u000e\u0010F\u001a\u00020\u001f2\u0006\u0010G\u001a\u00020\u0000J\u0010\u0010H\u001a\u00020\u00102\u0006\u0010I\u001a\u00020JH\u0016J\u001c\u0010K\u001a\u00020\u00002\b\b\u0002\u0010L\u001a\u00020\t2\b\b\u0002\u0010M\u001a\u00020\tH\u0017J\b\u0010N\u001a\u00020\u0000H\u0016J\b\u0010O\u001a\u00020\u0000H\u0016J\b\u0010P\u001a\u00020\u0004H\u0016J\b\u0010Q\u001a\u00020\u0010H\u0016J\b\u0010\u000f\u001a\u00020\u0010H\u0016J\u0010\u0010R\u001a\u00020?2\u0006\u0010S\u001a\u00020TH\u0016J%\u0010R\u001a\u00020?2\u0006\u0010U\u001a\u00020V2\u0006\u0010;\u001a\u00020\t2\u0006\u0010=\u001a\u00020\tH\u0010¢\u0006\u0002\bWJ\u0010\u0010X\u001a\u00020?2\u0006\u0010S\u001a\u00020YH\u0002R\u0014\u0010\u0003\u001a\u00020\u0004X\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007R\u001a\u0010\b\u001a\u00020\tX\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\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", "utf8", "", "getUtf8$okio", "()Ljava/lang/String;", "setUtf8$okio", "(Ljava/lang/String;)V", "asByteBuffer", "Ljava/nio/ByteBuffer;", "base64", "base64Url", "compareTo", "other", "digest", "algorithm", "digest$okio", "endsWith", "", "suffix", "equals", "", "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", "md5", "rangeEquals", "offset", "otherOffset", "byteCount", "readObject", "", "in", "Ljava/io/ObjectInputStream;", "sha1", "sha256", "sha512", "-deprecated_size", "startsWith", "prefix", "string", "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, 4, 0})
  /* compiled from: 01ED */
  public class ByteString implements Serializable, Comparable<ByteString> {
      public static final Companion Companion = new Companion((DefaultConstructorMarker) null);
      public static final ByteString EMPTY = new ByteString(new byte[0]);
      private static final long serialVersionUID = 1;
      private final byte[] data;
      private transient int hashCode;
      private transient String utf8;
  
      @Metadata(bv = {1, 0, 3}, 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\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\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000¨\u0006%"}, d2 = {"Lokio/ByteString$Companion;", "", "()V", "EMPTY", "Lokio/ByteString;", "serialVersionUID", "", "decodeBase64", "string", "", "-deprecated_decodeBase64", "decodeHex", "-deprecated_decodeHex", "encodeString", "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, 4, 0})
      /* compiled from: ByteString.kt */
      public static final class Companion {
          private Companion() {
          }
  
          public /* synthetic */ Companion(DefaultConstructorMarker $constructor_marker) {
              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 = bArr.length;
              }
              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"}))
          /* renamed from: -deprecated_decodeBase64  reason: not valid java name */
          public final ByteString m1729deprecated_decodeBase64(String string) {
              Intrinsics.checkNotNullParameter(string, TypedValues.Custom.S_STRING);
              return decodeBase64(string);
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.decodeHex()", imports = {"okio.ByteString.Companion.decodeHex"}))
          /* renamed from: -deprecated_decodeHex  reason: not valid java name */
          public final ByteString m1730deprecated_decodeHex(String string) {
              Intrinsics.checkNotNullParameter(string, TypedValues.Custom.S_STRING);
              return decodeHex(string);
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.encode(charset)", imports = {"okio.ByteString.Companion.encode"}))
          /* renamed from: -deprecated_encodeString  reason: not valid java name */
          public final ByteString m1731deprecated_encodeString(String string, Charset charset) {
              Intrinsics.checkNotNullParameter(string, TypedValues.Custom.S_STRING);
              Intrinsics.checkNotNullParameter(charset, "charset");
              return encodeString(string, charset);
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "string.encodeUtf8()", imports = {"okio.ByteString.Companion.encodeUtf8"}))
          /* renamed from: -deprecated_encodeUtf8  reason: not valid java name */
          public final ByteString m1732deprecated_encodeUtf8(String string) {
              Intrinsics.checkNotNullParameter(string, TypedValues.Custom.S_STRING);
              return encodeUtf8(string);
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "buffer.toByteString()", imports = {"okio.ByteString.Companion.toByteString"}))
          /* renamed from: -deprecated_of  reason: not valid java name */
          public final ByteString m1733deprecated_of(ByteBuffer buffer) {
              Intrinsics.checkNotNullParameter(buffer, "buffer");
              return of(buffer);
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "array.toByteString(offset, byteCount)", imports = {"okio.ByteString.Companion.toByteString"}))
          /* renamed from: -deprecated_of  reason: not valid java name */
          public final ByteString m1734deprecated_of(byte[] array, int offset, int byteCount) {
              Intrinsics.checkNotNullParameter(array, "array");
              return of(array, offset, byteCount);
          }
  
          @Deprecated(level = DeprecationLevel.ERROR, message = "moved to extension function", replaceWith = @ReplaceWith(expression = "inputstream.readByteString(byteCount)", imports = {"okio.ByteString.Companion.readByteString"}))
          /* renamed from: -deprecated_read  reason: not valid java name */
          public final ByteString m1735deprecated_read(InputStream inputstream, int byteCount) {
              Intrinsics.checkNotNullParameter(inputstream, "inputstream");
              return read(inputstream, byteCount);
          }
  
          @JvmStatic
          public final ByteString decodeBase64(String $this$decodeBase64) {
              Intrinsics.checkNotNullParameter($this$decodeBase64, "$this$decodeBase64");
              byte[] decodeBase64ToArray = Base64.decodeBase64ToArray($this$decodeBase64);
              if (decodeBase64ToArray != null) {
                  return new ByteString(decodeBase64ToArray);
              }
              return null;
          }
  
          @JvmStatic
          public final ByteString decodeHex(String $this$decodeHex) {
              Intrinsics.checkNotNullParameter($this$decodeHex, "$this$decodeHex");
              String str = $this$decodeHex;
              if (str.length() % 2 == 0) {
                  byte[] bArr = new byte[(str.length() / 2)];
                  int length = bArr.length;
                  for (int i = 0; i < length; i++) {
                      bArr[i] = (byte) ((ByteStringKt.decodeHexDigit(str.charAt(i * 2)) << 4) + ByteStringKt.decodeHexDigit(str.charAt((i * 2) + 1)));
                  }
                  return new ByteString(bArr);
              }
              throw new IllegalArgumentException(("Unexpected hex string: " + str).toString());
          }
  
          @JvmStatic
          public final ByteString encodeString(String $this$encode, Charset charset) {
              Intrinsics.checkNotNullParameter($this$encode, "$this$encode");
              Intrinsics.checkNotNullParameter(charset, "charset");
              byte[] bytes = $this$encode.getBytes(charset);
              Intrinsics.checkNotNullExpressionValue(bytes, "(this as java.lang.String).getBytes(charset)");
              return new ByteString(bytes);
          }
  
          @JvmStatic
          public final ByteString encodeUtf8(String $this$encodeUtf8) {
              Intrinsics.checkNotNullParameter($this$encodeUtf8, "$this$encodeUtf8");
              String str = $this$encodeUtf8;
              ByteString byteString = new ByteString(Platform.asUtf8ToByteArray(str));
              byteString.setUtf8$okio(str);
              return byteString;
          }
  
          @JvmStatic
          public final ByteString of(ByteBuffer $this$toByteString) {
              Intrinsics.checkNotNullParameter($this$toByteString, "$this$toByteString");
              byte[] bArr = new byte[$this$toByteString.remaining()];
              $this$toByteString.get(bArr);
              return new ByteString(bArr);
          }
  
          @JvmStatic
          public final ByteString of(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);
          }
  
          @JvmStatic
          public final ByteString of(byte[] $this$toByteString, int offset, int byteCount) {
              Intrinsics.checkNotNullParameter($this$toByteString, "$this$toByteString");
              byte[] bArr = $this$toByteString;
              Util.checkOffsetAndCount((long) bArr.length, (long) offset, (long) byteCount);
              return new ByteString(ArraysKt.copyOfRange(bArr, offset, offset + byteCount));
          }
  
          @JvmStatic
          public final ByteString read(InputStream $this$readByteString, int byteCount) throws IOException {
              Intrinsics.checkNotNullParameter($this$readByteString, "$this$readByteString");
              if (byteCount >= 0) {
                  byte[] bArr = new byte[byteCount];
                  int i = 0;
                  while (i < byteCount) {
                      int read = $this$readByteString.read(bArr, i, byteCount - i);
                      if (read != -1) {
                          i += read;
                      } else {
                          throw new EOFException();
                      }
                  }
                  return new ByteString(bArr);
              }
              throw new IllegalArgumentException(("byteCount < 0: " + byteCount).toString());
          }
      }
  
      public ByteString(byte[] data2) {
          Intrinsics.checkNotNullParameter(data2, "data");
          this.data = data2;
      }
  
      @JvmStatic
      public static final ByteString decodeBase64(String str) {
          return Companion.decodeBase64(str);
      }
  
      @JvmStatic
      public static final ByteString decodeHex(String str) {
          return Companion.decodeHex(str);
      }
  
      @JvmStatic
      public static final ByteString encodeString(String str, Charset charset) {
          return Companion.encodeString(str, charset);
      }
  
      @JvmStatic
      public static final ByteString encodeUtf8(String str) {
          return Companion.encodeUtf8(str);
      }
  
      public static /* synthetic */ int indexOf$default(ByteString byteString, ByteString byteString2, int i, int i2, Object obj) {
          if (obj == null) {
              if ((i2 & 2) != 0) {
                  i = 0;
              }
              return byteString.indexOf(byteString2, i);
          }
          throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: indexOf");
      }
  
      public static /* synthetic */ int indexOf$default(ByteString byteString, byte[] bArr, int i, int i2, Object obj) {
          if (obj == null) {
              if ((i2 & 2) != 0) {
                  i = 0;
              }
              return byteString.indexOf(bArr, i);
          }
          throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: indexOf");
      }
  
      public static /* synthetic */ int lastIndexOf$default(ByteString byteString, ByteString byteString2, int i, int i2, Object obj) {
          if (obj == null) {
              if ((i2 & 2) != 0) {
                  i = byteString.size();
              }
              return byteString.lastIndexOf(byteString2, i);
          }
          throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: lastIndexOf");
      }
  
      public static /* synthetic */ int lastIndexOf$default(ByteString byteString, byte[] bArr, int i, int i2, Object obj) {
          if (obj == null) {
              if ((i2 & 2) != 0) {
                  i = byteString.size();
              }
              return byteString.lastIndexOf(bArr, i);
          }
          throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: lastIndexOf");
      }
  
      @JvmStatic
      public static final ByteString of(ByteBuffer byteBuffer) {
          return Companion.of(byteBuffer);
      }
  
      @JvmStatic
      public static final ByteString of(byte... bArr) {
          return Companion.of(bArr);
      }
  
      @JvmStatic
      public static final ByteString of(byte[] bArr, int i, int i2) {
          return Companion.of(bArr, i, i2);
      }
  
      @JvmStatic
      public static final ByteString read(InputStream inputStream, int i) throws IOException {
          return Companion.read(inputStream, i);
      }
  
      private final void readObject(ObjectInputStream in) throws IOException {
          ByteString read = Companion.read(in, in.readInt());
          Field declaredField = ByteString.class.getDeclaredField("data");
          Intrinsics.checkNotNullExpressionValue(declaredField, "field");
          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) {
              if ((i3 & 1) != 0) {
                  i = 0;
              }
              if ((i3 & 2) != 0) {
                  i2 = byteString.size();
              }
              return byteString.substring(i, i2);
          }
          throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: substring");
      }
  
      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 = {}))
      /* renamed from: -deprecated_getByte  reason: not valid java name */
      public final byte m1727deprecated_getByte(int index) {
          return getByte(index);
      }
  
      @Deprecated(level = DeprecationLevel.ERROR, message = "moved to val", replaceWith = @ReplaceWith(expression = "size", imports = {}))
      /* renamed from: -deprecated_size  reason: not valid java name */
      public final int m1728deprecated_size() {
          return size();
      }
  
      public ByteBuffer asByteBuffer() {
          ByteBuffer asReadOnlyBuffer = ByteBuffer.wrap(this.data).asReadOnlyBuffer();
          Intrinsics.checkNotNullExpressionValue(asReadOnlyBuffer, "ByteBuffer.wrap(data).asReadOnlyBuffer()");
          return asReadOnlyBuffer;
      }
  
      public String base64() {
          String encodeBase64$default = Base64.encodeBase64$default(getData$okio(), (byte[]) null, 1, (Object) null);
          Log1F380D.a((Object) encodeBase64$default);
          return encodeBase64$default;
      }
  
      public int compareTo(ByteString other) {
          Intrinsics.checkNotNullParameter(other, "other");
          int size = size();
          int size2 = other.size();
          int min = Math.min(size, size2);
          for (int i = 0; i < min; i++) {
              byte b = getByte(i) & UByte.MAX_VALUE;
              byte b2 = other.getByte(i) & UByte.MAX_VALUE;
              if (b != b2) {
                  return b < b2 ? -1 : 1;
              }
          }
          if (size == size2) {
              return 0;
          }
          return size < size2 ? -1 : 1;
      }
  
      public ByteString digest$okio(String algorithm) {
          Intrinsics.checkNotNullParameter(algorithm, "algorithm");
          byte[] digest = MessageDigest.getInstance(algorithm).digest(this.data);
          Intrinsics.checkNotNullExpressionValue(digest, "MessageDigest.getInstance(algorithm).digest(data)");
          return new ByteString(digest);
      }
  
      public final boolean endsWith(ByteString suffix) {
          Intrinsics.checkNotNullParameter(suffix, "suffix");
          return rangeEquals(size() - suffix.size(), suffix, 0, suffix.size());
      }
  
      public final boolean endsWith(byte[] suffix) {
          Intrinsics.checkNotNullParameter(suffix, "suffix");
          return rangeEquals(size() - suffix.length, suffix, 0, suffix.length);
      }
  
      public boolean equals(Object other) {
          if (other == this) {
              return true;
          }
          if (other instanceof ByteString) {
              return ((ByteString) other).size() == getData$okio().length && ((ByteString) other).rangeEquals(0, getData$okio(), 0, getData$okio().length);
          }
          return false;
      }
  
      public final byte getByte(int index) {
          return internalGet$okio(index);
      }
  
      public final byte[] getData$okio() {
          return this.data;
      }
  
      public final int getHashCode$okio() {
          return this.hashCode;
      }
  
      public int getSize$okio() {
          return getData$okio().length;
      }
  
      public final String getUtf8$okio() {
          return this.utf8;
      }
  
      public int hashCode() {
          int hashCode$okio = getHashCode$okio();
          if (hashCode$okio != 0) {
              return hashCode$okio;
          }
          int hashCode2 = Arrays.hashCode(getData$okio());
          setHashCode$okio(hashCode2);
          return hashCode2;
      }
  
      public ByteString hmac$okio(String algorithm, ByteString key) {
          Intrinsics.checkNotNullParameter(algorithm, "algorithm");
          Intrinsics.checkNotNullParameter(key, "key");
          try {
              Mac instance = Mac.getInstance(algorithm);
              instance.init(new SecretKeySpec(key.toByteArray(), algorithm));
              byte[] doFinal = instance.doFinal(this.data);
              Intrinsics.checkNotNullExpressionValue(doFinal, "mac.doFinal(data)");
              return new ByteString(doFinal);
          } catch (InvalidKeyException e) {
              throw new IllegalArgumentException(e);
          }
      }
  
      public ByteString hmacSha1(ByteString key) {
          Intrinsics.checkNotNullParameter(key, "key");
          return hmac$okio("HmacSHA1", key);
      }
  
      public ByteString hmacSha256(ByteString key) {
          Intrinsics.checkNotNullParameter(key, "key");
          return hmac$okio("HmacSHA256", key);
      }
  
      public ByteString hmacSha512(ByteString key) {
          Intrinsics.checkNotNullParameter(key, "key");
          return hmac$okio("HmacSHA512", key);
      }
  
      public final int indexOf(ByteString byteString) {
          return indexOf$default(this, byteString, 0, 2, (Object) null);
      }
  
      public final int indexOf(ByteString other, int fromIndex) {
          Intrinsics.checkNotNullParameter(other, "other");
          return indexOf(other.internalArray$okio(), fromIndex);
      }
  
      public final int indexOf(byte[] bArr) {
          return indexOf$default(this, bArr, 0, 2, (Object) null);
      }
  
      public int indexOf(byte[] other, int fromIndex) {
          Intrinsics.checkNotNullParameter(other, "other");
          int length = getData$okio().length - other.length;
          int max = Math.max(fromIndex, 0);
          if (max <= length) {
              while (!Util.arrayRangeEquals(getData$okio(), max, other, 0, other.length)) {
                  if (max != length) {
                      max++;
                  }
              }
              return max;
          }
          return -1;
      }
  
      public byte[] internalArray$okio() {
          return getData$okio();
      }
  
      public byte internalGet$okio(int pos) {
          return getData$okio()[pos];
      }
  
      public final int lastIndexOf(ByteString byteString) {
          return lastIndexOf$default(this, byteString, 0, 2, (Object) null);
      }
  
      public final int lastIndexOf(ByteString other, int fromIndex) {
          Intrinsics.checkNotNullParameter(other, "other");
          return lastIndexOf(other.internalArray$okio(), fromIndex);
      }
  
      public final int lastIndexOf(byte[] bArr) {
          return lastIndexOf$default(this, bArr, 0, 2, (Object) null);
      }
  
      public int lastIndexOf(byte[] other, int fromIndex) {
          Intrinsics.checkNotNullParameter(other, "other");
          for (int min = Math.min(fromIndex, getData$okio().length - other.length); min >= 0; min--) {
              if (Util.arrayRangeEquals(getData$okio(), min, other, 0, other.length)) {
                  return min;
              }
          }
          return -1;
      }
  
      public ByteString md5() {
          return digest$okio("MD5");
      }
  
      public boolean rangeEquals(int offset, ByteString other, int otherOffset, int byteCount) {
          Intrinsics.checkNotNullParameter(other, "other");
          return other.rangeEquals(otherOffset, getData$okio(), offset, byteCount);
      }
  
      public boolean rangeEquals(int offset, byte[] other, int otherOffset, int byteCount) {
          Intrinsics.checkNotNullParameter(other, "other");
          return offset >= 0 && offset <= getData$okio().length - byteCount && otherOffset >= 0 && otherOffset <= other.length - byteCount && Util.arrayRangeEquals(getData$okio(), offset, other, otherOffset, byteCount);
      }
  
      public final void setHashCode$okio(int i) {
          this.hashCode = i;
      }
  
      public final void setUtf8$okio(String str) {
          this.utf8 = str;
      }
  
      public ByteString sha1() {
          return digest$okio("SHA-1");
      }
  
      public ByteString sha256() {
          return digest$okio("SHA-256");
      }
  
      public ByteString sha512() {
          return digest$okio("SHA-512");
      }
  
      public final int size() {
          return getSize$okio();
      }
  
      public final boolean startsWith(ByteString prefix) {
          Intrinsics.checkNotNullParameter(prefix, "prefix");
          return rangeEquals(0, prefix, 0, prefix.size());
      }
  
      public final boolean startsWith(byte[] prefix) {
          Intrinsics.checkNotNullParameter(prefix, "prefix");
          return rangeEquals(0, prefix, 0, prefix.length);
      }
  
      public final ByteString substring() {
          return substring$default(this, 0, 0, 3, (Object) null);
      }
  
      public final ByteString substring(int i) {
          return substring$default(this, i, 0, 2, (Object) null);
      }
  
      public ByteString substring(int beginIndex, int endIndex) {
          boolean z = true;
          if (beginIndex >= 0) {
              if (endIndex <= getData$okio().length) {
                  if (endIndex - beginIndex < 0) {
                      z = false;
                  }
                  if (z) {
                      return (beginIndex == 0 && endIndex == getData$okio().length) ? this : new ByteString(ArraysKt.copyOfRange(getData$okio(), beginIndex, endIndex));
                  }
                  throw new IllegalArgumentException("endIndex < beginIndex".toString());
              }
              throw new IllegalArgumentException(("endIndex > length(" + getData$okio().length + ')').toString());
          }
          throw new IllegalArgumentException("beginIndex < 0".toString());
      }
  
      public ByteString toAsciiLowercase() {
          byte b;
          int i = 0;
          while (i < getData$okio().length) {
              byte b2 = getData$okio()[i];
              byte b3 = (byte) 65;
              if (b2 < b3 || b2 > (b = (byte) 90)) {
                  i++;
              } else {
                  byte[] data$okio = getData$okio();
                  byte[] copyOf = Arrays.copyOf(data$okio, data$okio.length);
                  Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
                  int i2 = i + 1;
                  copyOf[i] = (byte) (b2 + 32);
                  while (i2 < copyOf.length) {
                      byte b4 = copyOf[i2];
                      if (b4 < b3 || b4 > b) {
                          i2++;
                      } else {
                          copyOf[i2] = (byte) (b4 + 32);
                          i2++;
                      }
                  }
                  return new ByteString(copyOf);
              }
          }
          return this;
      }
  
      public ByteString toAsciiUppercase() {
          byte b;
          int i = 0;
          while (i < getData$okio().length) {
              byte b2 = getData$okio()[i];
              byte b3 = (byte) 97;
              if (b2 < b3 || b2 > (b = (byte) 122)) {
                  i++;
              } else {
                  byte[] data$okio = getData$okio();
                  byte[] copyOf = Arrays.copyOf(data$okio, data$okio.length);
                  Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
                  int i2 = i + 1;
                  copyOf[i] = (byte) (b2 - 32);
                  while (i2 < copyOf.length) {
                      byte b4 = copyOf[i2];
                      if (b4 < b3 || b4 > b) {
                          i2++;
                      } else {
                          copyOf[i2] = (byte) (b4 - 32);
                          i2++;
                      }
                  }
                  return new ByteString(copyOf);
              }
          }
          return this;
      }
  
      public byte[] toByteArray() {
          byte[] data$okio = getData$okio();
          byte[] copyOf = Arrays.copyOf(data$okio, data$okio.length);
          Intrinsics.checkNotNullExpressionValue(copyOf, "java.util.Arrays.copyOf(this, size)");
          return copyOf;
      }
  
      public void write(OutputStream out) throws IOException {
          Intrinsics.checkNotNullParameter(out, "out");
          out.write(this.data);
      }
  
      public void write$okio(Buffer buffer, int offset, int byteCount) {
          Intrinsics.checkNotNullParameter(buffer, "buffer");
          ByteStringKt.commonWrite(this, buffer, offset, byteCount);
      }
  
      public String base64Url() {
          String encodeBase64 = Base64.encodeBase64(getData$okio(), Base64.getBASE64_URL_SAFE());
          Log1F380D.a((Object) encodeBase64);
          return encodeBase64;
      }
  
      public String hex() {
          char[] cArr = new char[(getData$okio().length * 2)];
          int i = 0;
          for (byte b : getData$okio()) {
              int i2 = i + 1;
              cArr[i] = ByteStringKt.getHEX_DIGIT_CHARS()[(b >> 4) & 15];
              i = i2 + 1;
              cArr[i2] = ByteStringKt.getHEX_DIGIT_CHARS()[15 & b];
          }
          String str = new String(cArr);
          Log1F380D.a((Object) str);
          return str;
      }
  
      public String string(Charset charset) {
          Intrinsics.checkNotNullParameter(charset, "charset");
          String str = new String(this.data, charset);
          Log1F380D.a((Object) str);
          return str;
      }
  
      public String toString() {
          boolean z = true;
          if (getData$okio().length == 0) {
              return "[size=0]";
          }
          int access$codePointIndexToCharIndex = ByteStringKt.codePointIndexToCharIndex(getData$okio(), 64);
          if (access$codePointIndexToCharIndex != -1) {
              String utf82 = utf8();
              if (utf82 != null) {
                  String substring = utf82.substring(0, access$codePointIndexToCharIndex);
                  Intrinsics.checkNotNullExpressionValue(substring, "(this as java.lang.Strin…ing(startIndex, endIndex)");
                  String replace$default = StringsKt.replace$default(substring, "\\", "\\\\", false, 4, (Object) null);
                  Log1F380D.a((Object) replace$default);
                  String replace$default2 = StringsKt.replace$default(replace$default, "\n", "\\n", false, 4, (Object) null);
                  Log1F380D.a((Object) replace$default2);
                  String replace$default3 = StringsKt.replace$default(replace$default2, "\r", "\\r", false, 4, (Object) null);
                  Log1F380D.a((Object) replace$default3);
                  return access$codePointIndexToCharIndex < utf82.length() ? "[size=" + getData$okio().length + " text=" + replace$default3 + "…]" : "[text=" + replace$default3 + ']';
              }
              throw new NullPointerException("null cannot be cast to non-null type java.lang.String");
          } else if (getData$okio().length <= 64) {
              return "[hex=" + hex() + ']';
          } else {
              StringBuilder append = new StringBuilder().append("[size=").append(getData$okio().length).append(" hex=");
              ByteString byteString = this;
              if (64 <= byteString.getData$okio().length) {
                  if (64 - 0 < 0) {
                      z = false;
                  }
                  if (z) {
                      if (64 != byteString.getData$okio().length) {
                          byteString = new ByteString(ArraysKt.copyOfRange(byteString.getData$okio(), 0, 64));
                      }
                      return append.append(byteString.hex()).append("…]").toString();
                  }
                  throw new IllegalArgumentException("endIndex < beginIndex".toString());
              }
              throw new IllegalArgumentException(("endIndex > length(" + byteString.getData$okio().length + ')').toString());
          }
      }
  
      public String utf8() {
          String utf8$okio = getUtf8$okio();
          if (utf8$okio != null) {
              return utf8$okio;
          }
          String utf8String = Platform.toUtf8String(internalArray$okio());
          Log1F380D.a((Object) utf8String);
          setUtf8$okio(utf8String);
          return utf8String;
      }
  }
  