2021-11-08 18:25:28 +00:00
|
|
|
package g0;
|
|
|
|
|
2021-12-21 23:37:30 +00:00
|
|
|
import b.i.a.f.e.o.f;
|
2021-11-08 18:25:28 +00:00
|
|
|
import d0.t.j;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.security.MessageDigest;
|
|
|
|
import okio.ByteString;
|
|
|
|
/* compiled from: SegmentedByteString.kt */
|
|
|
|
public final class u extends ByteString {
|
2021-12-17 22:03:14 +00:00
|
|
|
public final transient byte[][] n;
|
|
|
|
public final transient int[] o;
|
2021-11-08 18:25:28 +00:00
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public u(byte[][] bArr, int[] iArr) {
|
2021-12-17 22:03:14 +00:00
|
|
|
super(ByteString.j.i());
|
2021-11-08 18:25:28 +00:00
|
|
|
m.checkParameterIsNotNull(bArr, "segments");
|
|
|
|
m.checkParameterIsNotNull(iArr, "directory");
|
2021-12-17 22:03:14 +00:00
|
|
|
this.n = bArr;
|
|
|
|
this.o = iArr;
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private final Object writeReplace() {
|
|
|
|
return u();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString, java.lang.Object
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (obj == this) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (obj instanceof ByteString) {
|
|
|
|
ByteString byteString = (ByteString) obj;
|
|
|
|
if (byteString.j() == j() && n(0, byteString, 0, j())) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public String f() {
|
|
|
|
return u().f();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public ByteString g(String str) {
|
|
|
|
m.checkParameterIsNotNull(str, "algorithm");
|
|
|
|
MessageDigest instance = MessageDigest.getInstance(str);
|
2021-12-17 22:03:14 +00:00
|
|
|
int length = this.n.length;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i = 0;
|
|
|
|
int i2 = 0;
|
|
|
|
while (i < length) {
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i3 = iArr[length + i];
|
|
|
|
int i4 = iArr[i];
|
2021-12-17 22:03:14 +00:00
|
|
|
instance.update(this.n[i], i3, i4 - i2);
|
2021-11-08 18:25:28 +00:00
|
|
|
i++;
|
|
|
|
i2 = i4;
|
|
|
|
}
|
|
|
|
byte[] digest = instance.digest();
|
|
|
|
m.checkExpressionValueIsNotNull(digest, "digest.digest()");
|
|
|
|
return new ByteString(digest);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString, java.lang.Object
|
|
|
|
public int hashCode() {
|
2021-12-17 22:03:14 +00:00
|
|
|
int i = this.l;
|
2021-11-08 18:25:28 +00:00
|
|
|
if (i != 0) {
|
|
|
|
return i;
|
|
|
|
}
|
2021-12-17 22:03:14 +00:00
|
|
|
int length = this.n.length;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i2 = 0;
|
|
|
|
int i3 = 1;
|
|
|
|
int i4 = 0;
|
|
|
|
while (i2 < length) {
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i5 = iArr[length + i2];
|
|
|
|
int i6 = iArr[i2];
|
2021-12-17 22:03:14 +00:00
|
|
|
byte[] bArr = this.n[i2];
|
2021-11-08 18:25:28 +00:00
|
|
|
int i7 = (i6 - i4) + i5;
|
|
|
|
while (i5 < i7) {
|
|
|
|
i3 = (i3 * 31) + bArr[i5];
|
|
|
|
i5++;
|
|
|
|
}
|
|
|
|
i2++;
|
|
|
|
i4 = i6;
|
|
|
|
}
|
2021-12-17 22:03:14 +00:00
|
|
|
this.l = i3;
|
2021-11-08 18:25:28 +00:00
|
|
|
return i3;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public int j() {
|
2021-12-17 22:03:14 +00:00
|
|
|
return this.o[this.n.length - 1];
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public String k() {
|
|
|
|
return u().k();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public byte[] l() {
|
|
|
|
return t();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public byte m(int i) {
|
2022-01-27 00:50:41 +00:00
|
|
|
f.B((long) this.o[this.n.length - 1], (long) i, 1);
|
|
|
|
int a1 = f.a1(this, i);
|
|
|
|
int i2 = a1 == 0 ? 0 : this.o[a1 - 1];
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
|
|
|
byte[][] bArr = this.n;
|
2022-01-27 00:50:41 +00:00
|
|
|
return bArr[a1][(i - i2) + iArr[bArr.length + a1]];
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public boolean n(int i, ByteString byteString, int i2, int i3) {
|
|
|
|
m.checkParameterIsNotNull(byteString, "other");
|
|
|
|
if (i < 0 || i > j() - i3) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
int i4 = i3 + i;
|
2022-01-27 00:50:41 +00:00
|
|
|
int a1 = f.a1(this, i);
|
2021-11-08 18:25:28 +00:00
|
|
|
while (i < i4) {
|
2022-01-27 00:50:41 +00:00
|
|
|
int i5 = a1 == 0 ? 0 : this.o[a1 - 1];
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
2022-01-27 00:50:41 +00:00
|
|
|
int i6 = iArr[this.n.length + a1];
|
|
|
|
int min = Math.min(i4, (iArr[a1] - i5) + i5) - i;
|
|
|
|
if (!byteString.o(i2, this.n[a1], (i - i5) + i6, min)) {
|
2021-11-08 18:25:28 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
i2 += min;
|
|
|
|
i += min;
|
2022-01-27 00:50:41 +00:00
|
|
|
a1++;
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public boolean o(int i, byte[] bArr, int i2, int i3) {
|
|
|
|
m.checkParameterIsNotNull(bArr, "other");
|
|
|
|
if (i < 0 || i > j() - i3 || i2 < 0 || i2 > bArr.length - i3) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
int i4 = i3 + i;
|
2022-01-27 00:50:41 +00:00
|
|
|
int a1 = f.a1(this, i);
|
2021-11-08 18:25:28 +00:00
|
|
|
while (i < i4) {
|
2022-01-27 00:50:41 +00:00
|
|
|
int i5 = a1 == 0 ? 0 : this.o[a1 - 1];
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
2022-01-27 00:50:41 +00:00
|
|
|
int i6 = iArr[this.n.length + a1];
|
|
|
|
int min = Math.min(i4, (iArr[a1] - i5) + i5) - i;
|
|
|
|
if (!f.h(this.n[a1], (i - i5) + i6, bArr, i2, min)) {
|
2021-11-08 18:25:28 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
i2 += min;
|
|
|
|
i += min;
|
2022-01-27 00:50:41 +00:00
|
|
|
a1++;
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public ByteString p() {
|
|
|
|
return u().p();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public void r(OutputStream outputStream) throws IOException {
|
|
|
|
m.checkParameterIsNotNull(outputStream, "out");
|
2021-12-17 22:03:14 +00:00
|
|
|
int length = this.n.length;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i = 0;
|
|
|
|
int i2 = 0;
|
|
|
|
while (i < length) {
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i3 = iArr[length + i];
|
|
|
|
int i4 = iArr[i];
|
2021-12-17 22:03:14 +00:00
|
|
|
outputStream.write(this.n[i], i3, i4 - i2);
|
2021-11-08 18:25:28 +00:00
|
|
|
i++;
|
|
|
|
i2 = i4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString
|
|
|
|
public void s(e eVar, int i, int i2) {
|
|
|
|
m.checkParameterIsNotNull(eVar, "buffer");
|
|
|
|
int i3 = i2 + i;
|
2022-01-27 00:50:41 +00:00
|
|
|
int a1 = f.a1(this, i);
|
2021-11-08 18:25:28 +00:00
|
|
|
while (i < i3) {
|
2022-01-27 00:50:41 +00:00
|
|
|
int i4 = a1 == 0 ? 0 : this.o[a1 - 1];
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
2022-01-27 00:50:41 +00:00
|
|
|
int i5 = iArr[this.n.length + a1];
|
|
|
|
int min = Math.min(i3, (iArr[a1] - i4) + i4) - i;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i6 = (i - i4) + i5;
|
2022-01-27 00:50:41 +00:00
|
|
|
s sVar = new s(this.n[a1], i6, i6 + min, true, false);
|
2021-12-17 22:03:14 +00:00
|
|
|
s sVar2 = eVar.j;
|
2021-11-08 18:25:28 +00:00
|
|
|
if (sVar2 == null) {
|
|
|
|
sVar.g = sVar;
|
|
|
|
sVar.f = sVar;
|
2021-12-17 22:03:14 +00:00
|
|
|
eVar.j = sVar;
|
2021-11-08 18:25:28 +00:00
|
|
|
} else {
|
|
|
|
s sVar3 = sVar2.g;
|
|
|
|
if (sVar3 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar3.b(sVar);
|
|
|
|
}
|
|
|
|
i += min;
|
2022-01-27 00:50:41 +00:00
|
|
|
a1++;
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
2021-12-17 22:03:14 +00:00
|
|
|
eVar.k += (long) j();
|
2021-11-08 18:25:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public byte[] t() {
|
|
|
|
byte[] bArr = new byte[j()];
|
2021-12-17 22:03:14 +00:00
|
|
|
int length = this.n.length;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i = 0;
|
|
|
|
int i2 = 0;
|
|
|
|
int i3 = 0;
|
|
|
|
while (i < length) {
|
2021-12-17 22:03:14 +00:00
|
|
|
int[] iArr = this.o;
|
2021-11-08 18:25:28 +00:00
|
|
|
int i4 = iArr[length + i];
|
|
|
|
int i5 = iArr[i];
|
|
|
|
int i6 = i5 - i2;
|
2021-12-17 22:03:14 +00:00
|
|
|
j.copyInto(this.n[i], bArr, i3, i4, i4 + i6);
|
2021-11-08 18:25:28 +00:00
|
|
|
i3 += i6;
|
|
|
|
i++;
|
|
|
|
i2 = i5;
|
|
|
|
}
|
|
|
|
return bArr;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.ByteString, java.lang.Object
|
|
|
|
public String toString() {
|
|
|
|
return u().toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
public final ByteString u() {
|
|
|
|
return new ByteString(t());
|
|
|
|
}
|
|
|
|
}
|