2021-11-02 06:38:17 +00:00
|
|
|
package g0;
|
|
|
|
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
2021-11-05 06:48:17 +00:00
|
|
|
import c.i.a.f.e.o.f;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.g0.c;
|
|
|
|
import d0.t.j;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import java.io.Closeable;
|
|
|
|
import java.io.EOFException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
import java.nio.channels.ByteChannel;
|
|
|
|
import java.nio.charset.Charset;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Objects;
|
|
|
|
import okio.BufferedSink;
|
|
|
|
import okio.ByteString;
|
|
|
|
/* compiled from: Buffer.kt */
|
|
|
|
public final class e implements g, BufferedSink, Cloneable, ByteChannel {
|
|
|
|
public s i;
|
|
|
|
public long j;
|
|
|
|
|
|
|
|
/* compiled from: Buffer.kt */
|
|
|
|
public static final class a implements Closeable {
|
|
|
|
public e i;
|
|
|
|
public boolean j;
|
|
|
|
public s k;
|
|
|
|
public long l = -1;
|
|
|
|
public byte[] m;
|
|
|
|
public int n = -1;
|
|
|
|
public int o = -1;
|
|
|
|
|
|
|
|
public final long a(long j) {
|
|
|
|
e eVar = this.i;
|
|
|
|
if (eVar == null) {
|
|
|
|
throw new IllegalStateException("not attached to a buffer".toString());
|
|
|
|
} else if (this.j) {
|
|
|
|
long j2 = eVar.j;
|
|
|
|
int i = 1;
|
|
|
|
int i2 = (j > j2 ? 1 : (j == j2 ? 0 : -1));
|
|
|
|
if (i2 <= 0) {
|
|
|
|
if (j >= 0) {
|
|
|
|
long j3 = j2 - j;
|
|
|
|
while (true) {
|
|
|
|
if (j3 > 0) {
|
|
|
|
s sVar = eVar.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s sVar2 = sVar.g;
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i3 = sVar2.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
long j4 = (long) (i3 - sVar2.b);
|
|
|
|
if (j4 > j3) {
|
2021-11-29 21:56:34 +00:00
|
|
|
sVar2.f2893c = i3 - ((int) j3);
|
2021-11-02 06:38:17 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
eVar.i = sVar2.a();
|
|
|
|
t.a(sVar2);
|
|
|
|
j3 -= j4;
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.k = null;
|
|
|
|
this.l = j;
|
|
|
|
this.m = null;
|
|
|
|
this.n = -1;
|
|
|
|
this.o = -1;
|
|
|
|
} else {
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.s("newSize < 0: ", j).toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
} else if (i2 > 0) {
|
|
|
|
long j5 = j - j2;
|
|
|
|
boolean z2 = true;
|
|
|
|
while (j5 > 0) {
|
|
|
|
s N = eVar.N(i);
|
2021-11-29 21:56:34 +00:00
|
|
|
int min = (int) Math.min(j5, (long) (8192 - N.f2893c));
|
|
|
|
int i4 = N.f2893c + min;
|
|
|
|
N.f2893c = i4;
|
2021-11-02 06:38:17 +00:00
|
|
|
j5 -= (long) min;
|
|
|
|
if (z2) {
|
|
|
|
this.k = N;
|
|
|
|
this.l = j2;
|
|
|
|
this.m = N.a;
|
|
|
|
this.n = i4 - min;
|
|
|
|
this.o = i4;
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
i = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eVar.j = j;
|
|
|
|
return j2;
|
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("resizeBuffer() only permitted for read/write buffers".toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final int b(long j) {
|
|
|
|
long j2;
|
|
|
|
s sVar;
|
|
|
|
e eVar = this.i;
|
|
|
|
if (eVar != null) {
|
|
|
|
if (j >= ((long) -1)) {
|
|
|
|
long j3 = eVar.j;
|
|
|
|
if (j <= j3) {
|
|
|
|
if (j == -1 || j == j3) {
|
|
|
|
this.k = null;
|
|
|
|
this.l = j;
|
|
|
|
this.m = null;
|
|
|
|
this.n = -1;
|
|
|
|
this.o = -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
s sVar2 = eVar.i;
|
|
|
|
s sVar3 = this.k;
|
|
|
|
if (sVar3 != null) {
|
|
|
|
long j4 = this.l;
|
|
|
|
int i = this.n;
|
|
|
|
if (sVar3 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j2 = j4 - ((long) (i - sVar3.b));
|
|
|
|
if (j2 > j) {
|
|
|
|
sVar = sVar2;
|
|
|
|
sVar2 = this.k;
|
|
|
|
j3 = j2;
|
|
|
|
j2 = 0;
|
|
|
|
} else {
|
|
|
|
sVar = this.k;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
j2 = 0;
|
|
|
|
sVar = sVar2;
|
|
|
|
}
|
|
|
|
if (j3 - j > j - j2) {
|
|
|
|
while (true) {
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
int i3 = sVar.b;
|
|
|
|
if (j < ((long) (i2 - i3)) + j2) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
j2 += (long) (i2 - i3);
|
|
|
|
sVar = sVar.f;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
while (j3 > j) {
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar2 = sVar2.g;
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j3 -= (long) (sVar2.f2893c - sVar2.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
sVar = sVar2;
|
|
|
|
j2 = j3;
|
|
|
|
}
|
|
|
|
if (this.j) {
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
if (sVar.d) {
|
|
|
|
byte[] bArr = sVar.a;
|
|
|
|
byte[] copyOf = Arrays.copyOf(bArr, bArr.length);
|
|
|
|
m.checkExpressionValueIsNotNull(copyOf, "java.util.Arrays.copyOf(this, size)");
|
2021-11-29 21:56:34 +00:00
|
|
|
s sVar4 = new s(copyOf, sVar.b, sVar.f2893c, false, true);
|
2021-11-02 06:38:17 +00:00
|
|
|
if (eVar.i == sVar) {
|
|
|
|
eVar.i = sVar4;
|
|
|
|
}
|
|
|
|
sVar.b(sVar4);
|
|
|
|
s sVar5 = sVar4.g;
|
|
|
|
if (sVar5 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar5.a();
|
|
|
|
sVar = sVar4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.k = sVar;
|
|
|
|
this.l = j;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
this.m = sVar.a;
|
|
|
|
int i4 = sVar.b + ((int) (j - j2));
|
|
|
|
this.n = i4;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i5 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.o = i5;
|
|
|
|
return i5 - i4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String format = String.format("offset=%s > size=%s", Arrays.copyOf(new Object[]{Long.valueOf(j), Long.valueOf(eVar.j)}, 2));
|
|
|
|
m.checkExpressionValueIsNotNull(format, "java.lang.String.format(format, *args)");
|
|
|
|
throw new ArrayIndexOutOfBoundsException(format);
|
|
|
|
}
|
|
|
|
throw new IllegalStateException("not attached to a buffer".toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.io.Closeable, java.lang.AutoCloseable
|
|
|
|
public void close() {
|
|
|
|
if (this.i != null) {
|
|
|
|
this.i = null;
|
|
|
|
this.k = null;
|
|
|
|
this.l = -1;
|
|
|
|
this.m = null;
|
|
|
|
this.n = -1;
|
|
|
|
this.o = -1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
throw new IllegalStateException("not attached to a buffer".toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: Buffer.kt */
|
|
|
|
public static final class b extends InputStream {
|
|
|
|
public final /* synthetic */ e i;
|
|
|
|
|
|
|
|
public b(e eVar) {
|
|
|
|
this.i = eVar;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.io.InputStream
|
|
|
|
public int available() {
|
|
|
|
return (int) Math.min(this.i.j, (long) Integer.MAX_VALUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable
|
|
|
|
public void close() {
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.io.InputStream
|
|
|
|
public int read() {
|
|
|
|
e eVar = this.i;
|
|
|
|
if (eVar.j > 0) {
|
|
|
|
return eVar.readByte() & 255;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.io.InputStream
|
|
|
|
public int read(byte[] bArr, int i, int i2) {
|
|
|
|
m.checkParameterIsNotNull(bArr, "sink");
|
|
|
|
return this.i.read(bArr, i, i2);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
|
|
|
return this.i + ".inputStream()";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
public String A(long j, Charset charset) throws EOFException {
|
2021-11-02 06:38:17 +00:00
|
|
|
m.checkParameterIsNotNull(charset, "charset");
|
|
|
|
int i = (j > 0 ? 1 : (j == 0 ? 0 : -1));
|
|
|
|
if (!(i >= 0 && j <= ((long) Integer.MAX_VALUE))) {
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.s("byteCount: ", j).toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
} else if (this.j < j) {
|
|
|
|
throw new EOFException();
|
|
|
|
} else if (i == 0) {
|
|
|
|
return "";
|
|
|
|
} else {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
int i2 = sVar.b;
|
2021-11-29 21:56:34 +00:00
|
|
|
if (((long) i2) + j > ((long) sVar.f2893c)) {
|
2021-11-05 06:48:17 +00:00
|
|
|
return new String(Z(j), charset);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
int i3 = (int) j;
|
|
|
|
String str = new String(sVar.a, i2, i3, charset);
|
|
|
|
int i4 = sVar.b + i3;
|
|
|
|
sVar.b = i4;
|
|
|
|
this.j -= j;
|
2021-11-29 21:56:34 +00:00
|
|
|
if (i4 == sVar.f2893c) {
|
2021-11-02 06:38:17 +00:00
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
}
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
2021-11-05 06:48:17 +00:00
|
|
|
public void B(e eVar, long j) throws EOFException {
|
|
|
|
m.checkParameterIsNotNull(eVar, "sink");
|
|
|
|
long j2 = this.j;
|
|
|
|
if (j2 >= j) {
|
|
|
|
eVar.write(this, j);
|
|
|
|
} else {
|
|
|
|
eVar.write(this, j2);
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public String D() {
|
|
|
|
return A(this.j, c.a);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public long E(ByteString byteString) {
|
2021-11-02 06:38:17 +00:00
|
|
|
m.checkParameterIsNotNull(byteString, "targetBytes");
|
|
|
|
return t(byteString, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink
|
2021-11-05 06:48:17 +00:00
|
|
|
public BufferedSink F() {
|
2021-11-02 06:38:17 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
2021-11-05 06:48:17 +00:00
|
|
|
public String G(long j) throws EOFException {
|
2021-11-02 06:38:17 +00:00
|
|
|
if (j >= 0) {
|
|
|
|
long j2 = RecyclerView.FOREVER_NS;
|
|
|
|
if (j != RecyclerView.FOREVER_NS) {
|
|
|
|
j2 = j + 1;
|
|
|
|
}
|
|
|
|
byte b2 = (byte) 10;
|
|
|
|
long s2 = s(b2, 0, j2);
|
|
|
|
if (s2 != -1) {
|
|
|
|
return g0.z.a.a(this, s2);
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
if (j2 < this.j && q(j2 - 1) == ((byte) 13) && q(j2) == b2) {
|
2021-11-02 06:38:17 +00:00
|
|
|
return g0.z.a.a(this, j2);
|
|
|
|
}
|
|
|
|
e eVar = new e();
|
2021-11-05 06:48:17 +00:00
|
|
|
n(eVar, 0, Math.min((long) 32, this.j));
|
2021-11-02 06:38:17 +00:00
|
|
|
throw new EOFException("\\n not found: limit=" + Math.min(this.j, j) + " content=" + eVar.x().k() + (char) 8230);
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.s("limit < 0: ", j).toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public String H(long j) throws EOFException {
|
2021-11-05 06:48:17 +00:00
|
|
|
return A(j, c.a);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int I() throws EOFException {
|
|
|
|
int i;
|
|
|
|
int i2;
|
|
|
|
int i3;
|
|
|
|
if (this.j != 0) {
|
2021-11-05 06:48:17 +00:00
|
|
|
byte q = q(0);
|
|
|
|
if ((q & 128) == 0) {
|
|
|
|
i3 = q & Byte.MAX_VALUE;
|
2021-11-02 06:38:17 +00:00
|
|
|
i2 = 1;
|
|
|
|
i = 0;
|
2021-11-05 06:48:17 +00:00
|
|
|
} else if ((q & 224) == 192) {
|
|
|
|
i3 = q & 31;
|
2021-11-02 06:38:17 +00:00
|
|
|
i2 = 2;
|
|
|
|
i = 128;
|
2021-11-05 06:48:17 +00:00
|
|
|
} else if ((q & 240) == 224) {
|
|
|
|
i3 = q & 15;
|
2021-11-02 06:38:17 +00:00
|
|
|
i2 = 3;
|
|
|
|
i = 2048;
|
2021-11-05 06:48:17 +00:00
|
|
|
} else if ((q & 248) == 240) {
|
|
|
|
i3 = q & 7;
|
2021-11-02 06:38:17 +00:00
|
|
|
i2 = 4;
|
|
|
|
i = 65536;
|
|
|
|
} else {
|
|
|
|
skip(1);
|
|
|
|
return 65533;
|
|
|
|
}
|
|
|
|
long j = (long) i2;
|
|
|
|
if (this.j >= j) {
|
|
|
|
for (int i4 = 1; i4 < i2; i4++) {
|
|
|
|
long j2 = (long) i4;
|
2021-11-05 06:48:17 +00:00
|
|
|
byte q2 = q(j2);
|
|
|
|
if ((q2 & 192) == 128) {
|
|
|
|
i3 = (i3 << 6) | (q2 & 63);
|
2021-11-02 06:38:17 +00:00
|
|
|
} else {
|
|
|
|
skip(j2);
|
|
|
|
return 65533;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
skip(j);
|
|
|
|
if (i3 > 1114111) {
|
|
|
|
return 65533;
|
|
|
|
}
|
|
|
|
if ((55296 <= i3 && 57343 >= i3) || i3 < i) {
|
|
|
|
return 65533;
|
|
|
|
}
|
|
|
|
return i3;
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder S = c.d.b.a.a.S("size < ", i2, ": ");
|
|
|
|
S.append(this.j);
|
|
|
|
S.append(" (to read code point prefixed 0x");
|
|
|
|
S.append(f.c1(q));
|
|
|
|
S.append(')');
|
|
|
|
throw new EOFException(S.toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
public final ByteString J(int i) {
|
2021-11-02 06:38:17 +00:00
|
|
|
if (i == 0) {
|
|
|
|
return ByteString.i;
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
f.w(this.j, 0, (long) i);
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar = this.i;
|
|
|
|
int i2 = 0;
|
|
|
|
int i3 = 0;
|
|
|
|
int i4 = 0;
|
|
|
|
while (i3 < i) {
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i5 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
int i6 = sVar.b;
|
|
|
|
if (i5 != i6) {
|
|
|
|
i3 += i5 - i6;
|
|
|
|
i4++;
|
|
|
|
sVar = sVar.f;
|
|
|
|
} else {
|
|
|
|
throw new AssertionError("s.limit == s.pos");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
byte[][] bArr = new byte[i4][];
|
|
|
|
int[] iArr = new int[(i4 * 2)];
|
|
|
|
s sVar2 = this.i;
|
|
|
|
int i7 = 0;
|
|
|
|
while (i2 < i) {
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
bArr[i7] = sVar2.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
i2 += sVar2.f2893c - sVar2.b;
|
2021-11-02 06:38:17 +00:00
|
|
|
iArr[i7] = Math.min(i2, i);
|
|
|
|
iArr[i7 + i4] = sVar2.b;
|
|
|
|
sVar2.d = true;
|
|
|
|
i7++;
|
|
|
|
sVar2 = sVar2.f;
|
|
|
|
}
|
|
|
|
return new u(bArr, iArr);
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public /* bridge */ /* synthetic */ BufferedSink K(String str) {
|
|
|
|
b0(str);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public String M(Charset charset) {
|
|
|
|
m.checkParameterIsNotNull(charset, "charset");
|
|
|
|
return A(this.j, charset);
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
public final s N(int i) {
|
|
|
|
boolean z2 = true;
|
|
|
|
if (i < 1 || i > 8192) {
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
s b2 = t.b();
|
|
|
|
this.i = b2;
|
|
|
|
b2.g = b2;
|
|
|
|
b2.f = b2;
|
|
|
|
return b2;
|
|
|
|
}
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s sVar2 = sVar.g;
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
if (sVar2.f2893c + i <= 8192 && sVar2.e) {
|
2021-11-02 06:38:17 +00:00
|
|
|
return sVar2;
|
|
|
|
}
|
|
|
|
s b3 = t.b();
|
|
|
|
sVar2.b(b3);
|
|
|
|
return b3;
|
|
|
|
}
|
|
|
|
throw new IllegalArgumentException("unexpected capacity".toString());
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
public e O(ByteString byteString) {
|
|
|
|
m.checkParameterIsNotNull(byteString, "byteString");
|
|
|
|
byteString.s(this, 0, byteString.j());
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // okio.BufferedSink
|
2021-11-05 06:48:17 +00:00
|
|
|
public long P(x xVar) throws IOException {
|
2021-11-02 06:38:17 +00:00
|
|
|
m.checkParameterIsNotNull(xVar, "source");
|
|
|
|
long j = 0;
|
|
|
|
while (true) {
|
2021-11-05 06:48:17 +00:00
|
|
|
long i02 = xVar.i0(this, (long) 8192);
|
|
|
|
if (i02 == -1) {
|
2021-11-02 06:38:17 +00:00
|
|
|
return j;
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
j += i02;
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public e R(byte[] bArr) {
|
|
|
|
m.checkParameterIsNotNull(bArr, "source");
|
|
|
|
S(bArr, 0, bArr.length);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public e S(byte[] bArr, int i, int i2) {
|
|
|
|
m.checkParameterIsNotNull(bArr, "source");
|
|
|
|
long j = (long) i2;
|
2021-11-05 06:48:17 +00:00
|
|
|
f.w((long) bArr.length, (long) i, j);
|
2021-11-02 06:38:17 +00:00
|
|
|
int i3 = i2 + i;
|
|
|
|
while (i < i3) {
|
|
|
|
s N = N(1);
|
2021-11-29 21:56:34 +00:00
|
|
|
int min = Math.min(i3 - i, 8192 - N.f2893c);
|
2021-11-02 06:38:17 +00:00
|
|
|
int i4 = i + min;
|
2021-11-29 21:56:34 +00:00
|
|
|
j.copyInto(bArr, N.a, N.f2893c, i, i4);
|
|
|
|
N.f2893c += min;
|
2021-11-02 06:38:17 +00:00
|
|
|
i = i4;
|
|
|
|
}
|
|
|
|
this.j += j;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public e T(int i) {
|
|
|
|
s N = N(1);
|
|
|
|
byte[] bArr = N.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = N.f2893c;
|
|
|
|
N.f2893c = i2 + 1;
|
2021-11-02 06:38:17 +00:00
|
|
|
bArr[i2] = (byte) i;
|
|
|
|
this.j++;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* renamed from: U */
|
2021-11-05 06:48:17 +00:00
|
|
|
public e q0(long j) {
|
2021-11-02 06:38:17 +00:00
|
|
|
int i = (j > 0 ? 1 : (j == 0 ? 0 : -1));
|
|
|
|
if (i == 0) {
|
|
|
|
T(48);
|
|
|
|
} else {
|
|
|
|
boolean z2 = false;
|
|
|
|
int i2 = 1;
|
|
|
|
if (i < 0) {
|
|
|
|
j = -j;
|
|
|
|
if (j < 0) {
|
|
|
|
b0("-9223372036854775808");
|
|
|
|
} else {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (j >= 100000000) {
|
|
|
|
i2 = j < 1000000000000L ? j < 10000000000L ? j < 1000000000 ? 9 : 10 : j < 100000000000L ? 11 : 12 : j < 1000000000000000L ? j < 10000000000000L ? 13 : j < 100000000000000L ? 14 : 15 : j < 100000000000000000L ? j < 10000000000000000L ? 16 : 17 : j < 1000000000000000000L ? 18 : 19;
|
|
|
|
} else if (j >= 10000) {
|
|
|
|
i2 = j < 1000000 ? j < 100000 ? 5 : 6 : j < 10000000 ? 7 : 8;
|
|
|
|
} else if (j >= 100) {
|
|
|
|
i2 = j < 1000 ? 3 : 4;
|
|
|
|
} else if (j >= 10) {
|
|
|
|
i2 = 2;
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
i2++;
|
|
|
|
}
|
|
|
|
s N = N(i2);
|
|
|
|
byte[] bArr = N.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i3 = N.f2893c + i2;
|
2021-11-02 06:38:17 +00:00
|
|
|
while (j != 0) {
|
|
|
|
long j2 = (long) 10;
|
|
|
|
i3--;
|
|
|
|
bArr[i3] = g0.z.a.a[(int) (j % j2)];
|
|
|
|
j /= j2;
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
bArr[i3 - 1] = (byte) 45;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
N.f2893c += i2;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += (long) i2;
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* renamed from: V */
|
2021-11-05 06:48:17 +00:00
|
|
|
public e Q(long j) {
|
2021-11-02 06:38:17 +00:00
|
|
|
if (j == 0) {
|
|
|
|
T(48);
|
|
|
|
} else {
|
|
|
|
long j2 = (j >>> 1) | j;
|
|
|
|
long j3 = j2 | (j2 >>> 2);
|
|
|
|
long j4 = j3 | (j3 >>> 4);
|
|
|
|
long j5 = j4 | (j4 >>> 8);
|
|
|
|
long j6 = j5 | (j5 >>> 16);
|
|
|
|
long j7 = j6 | (j6 >>> 32);
|
|
|
|
long j8 = j7 - ((j7 >>> 1) & 6148914691236517205L);
|
|
|
|
long j9 = ((j8 >>> 2) & 3689348814741910323L) + (j8 & 3689348814741910323L);
|
|
|
|
long j10 = ((j9 >>> 4) + j9) & 1085102592571150095L;
|
|
|
|
long j11 = j10 + (j10 >>> 8);
|
|
|
|
long j12 = j11 + (j11 >>> 16);
|
|
|
|
int i = (int) ((((j12 & 63) + ((j12 >>> 32) & 63)) + ((long) 3)) / ((long) 4));
|
|
|
|
s N = N(i);
|
|
|
|
byte[] bArr = N.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = N.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
for (int i3 = (i2 + i) - 1; i3 >= i2; i3--) {
|
|
|
|
bArr[i3] = g0.z.a.a[(int) (15 & j)];
|
|
|
|
j >>>= 4;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
N.f2893c += i;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += (long) i;
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public e W(int i) {
|
|
|
|
s N = N(4);
|
|
|
|
byte[] bArr = N.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = N.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
int i3 = i2 + 1;
|
|
|
|
bArr[i2] = (byte) ((i >>> 24) & 255);
|
|
|
|
int i4 = i3 + 1;
|
|
|
|
bArr[i3] = (byte) ((i >>> 16) & 255);
|
|
|
|
int i5 = i4 + 1;
|
|
|
|
bArr[i4] = (byte) ((i >>> 8) & 255);
|
|
|
|
bArr[i5] = (byte) (i & 255);
|
2021-11-29 21:56:34 +00:00
|
|
|
N.f2893c = i5 + 1;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += 4;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
public e X(int i) {
|
|
|
|
s N = N(2);
|
|
|
|
byte[] bArr = N.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = N.f2893c;
|
2021-11-05 06:48:17 +00:00
|
|
|
int i3 = i2 + 1;
|
|
|
|
bArr[i2] = (byte) ((i >>> 8) & 255);
|
|
|
|
bArr[i3] = (byte) (i & 255);
|
2021-11-29 21:56:34 +00:00
|
|
|
N.f2893c = i3 + 1;
|
2021-11-05 06:48:17 +00:00
|
|
|
this.j += 2;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // g0.g
|
2021-11-05 06:48:17 +00:00
|
|
|
public String Y() throws EOFException {
|
|
|
|
return G(RecyclerView.FOREVER_NS);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
2021-11-05 06:48:17 +00:00
|
|
|
public byte[] Z(long j) throws EOFException {
|
2021-11-02 06:38:17 +00:00
|
|
|
if (!(j >= 0 && j <= ((long) Integer.MAX_VALUE))) {
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.s("byteCount: ", j).toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
} else if (this.j >= j) {
|
|
|
|
byte[] bArr = new byte[((int) j)];
|
|
|
|
readFully(bArr);
|
|
|
|
return bArr;
|
|
|
|
} else {
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* renamed from: b */
|
|
|
|
public e clone() {
|
|
|
|
e eVar = new e();
|
|
|
|
if (this.j != 0) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s c2 = sVar.c();
|
|
|
|
eVar.i = c2;
|
|
|
|
c2.g = c2;
|
|
|
|
c2.f = c2;
|
|
|
|
for (s sVar2 = sVar.f; sVar2 != sVar; sVar2 = sVar2.f) {
|
|
|
|
s sVar3 = c2.g;
|
|
|
|
if (sVar3 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar3.b(sVar2.c());
|
|
|
|
}
|
|
|
|
eVar.j = this.j;
|
|
|
|
}
|
|
|
|
return eVar;
|
|
|
|
}
|
|
|
|
|
|
|
|
public e b0(String str) {
|
|
|
|
m.checkParameterIsNotNull(str, "string");
|
|
|
|
c0(str, 0, str.length());
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public e c0(String str, int i, int i2) {
|
|
|
|
char charAt;
|
|
|
|
m.checkParameterIsNotNull(str, "string");
|
|
|
|
if (i >= 0) {
|
|
|
|
if (i2 >= i) {
|
|
|
|
if (i2 <= str.length()) {
|
|
|
|
while (i < i2) {
|
|
|
|
char charAt2 = str.charAt(i);
|
|
|
|
if (charAt2 < 128) {
|
|
|
|
s N = N(1);
|
|
|
|
byte[] bArr = N.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i3 = N.f2893c - i;
|
2021-11-02 06:38:17 +00:00
|
|
|
int min = Math.min(i2, 8192 - i3);
|
|
|
|
int i4 = i + 1;
|
|
|
|
bArr[i + i3] = (byte) charAt2;
|
|
|
|
while (true) {
|
|
|
|
i = i4;
|
|
|
|
if (i >= min || (charAt = str.charAt(i)) >= 128) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
i4 = i + 1;
|
|
|
|
bArr[i + i3] = (byte) charAt;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i5 = N.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
int i6 = (i3 + i) - i5;
|
2021-11-29 21:56:34 +00:00
|
|
|
N.f2893c = i5 + i6;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += (long) i6;
|
|
|
|
} else {
|
|
|
|
if (charAt2 < 2048) {
|
|
|
|
s N2 = N(2);
|
|
|
|
byte[] bArr2 = N2.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i7 = N2.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
bArr2[i7] = (byte) ((charAt2 >> 6) | 192);
|
|
|
|
bArr2[i7 + 1] = (byte) ((charAt2 & '?') | 128);
|
2021-11-29 21:56:34 +00:00
|
|
|
N2.f2893c = i7 + 2;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += 2;
|
|
|
|
} else if (charAt2 < 55296 || charAt2 > 57343) {
|
|
|
|
s N3 = N(3);
|
|
|
|
byte[] bArr3 = N3.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i8 = N3.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
bArr3[i8] = (byte) ((charAt2 >> '\f') | 224);
|
|
|
|
bArr3[i8 + 1] = (byte) ((63 & (charAt2 >> 6)) | 128);
|
|
|
|
bArr3[i8 + 2] = (byte) ((charAt2 & '?') | 128);
|
2021-11-29 21:56:34 +00:00
|
|
|
N3.f2893c = i8 + 3;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += 3;
|
|
|
|
} else {
|
|
|
|
int i9 = i + 1;
|
|
|
|
char charAt3 = i9 < i2 ? str.charAt(i9) : 0;
|
|
|
|
if (charAt2 > 56319 || 56320 > charAt3 || 57343 < charAt3) {
|
|
|
|
T(63);
|
|
|
|
i = i9;
|
|
|
|
} else {
|
|
|
|
int i10 = (((charAt2 & 1023) << 10) | (charAt3 & 1023)) + 65536;
|
|
|
|
s N4 = N(4);
|
|
|
|
byte[] bArr4 = N4.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i11 = N4.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
bArr4[i11] = (byte) ((i10 >> 18) | 240);
|
|
|
|
bArr4[i11 + 1] = (byte) (((i10 >> 12) & 63) | 128);
|
|
|
|
bArr4[i11 + 2] = (byte) (((i10 >> 6) & 63) | 128);
|
|
|
|
bArr4[i11 + 3] = (byte) ((i10 & 63) | 128);
|
2021-11-29 21:56:34 +00:00
|
|
|
N4.f2893c = i11 + 4;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += 4;
|
|
|
|
i += 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder S = c.d.b.a.a.S("endIndex > string.length: ", i2, " > ");
|
|
|
|
S.append(str.length());
|
|
|
|
throw new IllegalArgumentException(S.toString().toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.r("endIndex < beginIndex: ", i2, " < ", i).toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.p("beginIndex < 0: ", i).toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.x, java.io.Closeable, java.lang.AutoCloseable
|
|
|
|
public void close() {
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
public e d0(int i) {
|
2021-11-02 06:38:17 +00:00
|
|
|
String str;
|
|
|
|
if (i < 128) {
|
|
|
|
T(i);
|
|
|
|
} else if (i < 2048) {
|
|
|
|
s N = N(2);
|
|
|
|
byte[] bArr = N.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = N.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
bArr[i2] = (byte) ((i >> 6) | 192);
|
|
|
|
bArr[i2 + 1] = (byte) ((i & 63) | 128);
|
2021-11-29 21:56:34 +00:00
|
|
|
N.f2893c = i2 + 2;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += 2;
|
|
|
|
} else if (55296 <= i && 57343 >= i) {
|
|
|
|
T(63);
|
|
|
|
} else if (i < 65536) {
|
|
|
|
s N2 = N(3);
|
|
|
|
byte[] bArr2 = N2.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i3 = N2.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
bArr2[i3] = (byte) ((i >> 12) | 224);
|
|
|
|
bArr2[i3 + 1] = (byte) (((i >> 6) & 63) | 128);
|
|
|
|
bArr2[i3 + 2] = (byte) ((i & 63) | 128);
|
2021-11-29 21:56:34 +00:00
|
|
|
N2.f2893c = i3 + 3;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += 3;
|
|
|
|
} else if (i <= 1114111) {
|
|
|
|
s N3 = N(4);
|
|
|
|
byte[] bArr3 = N3.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i4 = N3.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
bArr3[i4] = (byte) ((i >> 18) | 240);
|
|
|
|
bArr3[i4 + 1] = (byte) (((i >> 12) & 63) | 128);
|
|
|
|
bArr3[i4 + 2] = (byte) (((i >> 6) & 63) | 128);
|
|
|
|
bArr3[i4 + 3] = (byte) ((i & 63) | 128);
|
2021-11-29 21:56:34 +00:00
|
|
|
N3.f2893c = i4 + 4;
|
2021-11-02 06:38:17 +00:00
|
|
|
this.j += 4;
|
|
|
|
} else {
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder R = c.d.b.a.a.R("Unexpected code point: 0x");
|
2021-11-02 06:38:17 +00:00
|
|
|
if (i != 0) {
|
|
|
|
char[] cArr = g0.z.b.a;
|
|
|
|
int i5 = 0;
|
|
|
|
char[] cArr2 = {cArr[(i >> 28) & 15], cArr[(i >> 24) & 15], cArr[(i >> 20) & 15], cArr[(i >> 16) & 15], cArr[(i >> 12) & 15], cArr[(i >> 8) & 15], cArr[(i >> 4) & 15], cArr[i & 15]};
|
|
|
|
while (i5 < 8 && cArr2[i5] == '0') {
|
|
|
|
i5++;
|
|
|
|
}
|
|
|
|
str = new String(cArr2, i5, 8 - i5);
|
|
|
|
} else {
|
|
|
|
str = "0";
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
R.append(str);
|
|
|
|
throw new IllegalArgumentException(R.toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public /* bridge */ /* synthetic */ BufferedSink e0(ByteString byteString) {
|
|
|
|
O(byteString);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // java.lang.Object
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this != obj) {
|
|
|
|
if (!(obj instanceof e)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
long j = this.j;
|
|
|
|
e eVar = (e) obj;
|
|
|
|
if (j != eVar.j) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (j != 0) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s sVar2 = eVar.i;
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
int i = sVar.b;
|
|
|
|
int i2 = sVar2.b;
|
|
|
|
long j2 = 0;
|
|
|
|
while (j2 < this.j) {
|
2021-11-29 21:56:34 +00:00
|
|
|
long min = (long) Math.min(sVar.f2893c - i, sVar2.f2893c - i2);
|
2021-11-02 06:38:17 +00:00
|
|
|
long j3 = 0;
|
|
|
|
while (j3 < min) {
|
|
|
|
int i3 = i + 1;
|
|
|
|
int i4 = i2 + 1;
|
|
|
|
if (sVar.a[i] != sVar2.a[i2]) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
j3++;
|
|
|
|
i = i3;
|
|
|
|
i2 = i4;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
if (i == sVar.f2893c) {
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
i = sVar.b;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
if (i2 == sVar2.f2893c) {
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar2 = sVar2.f;
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
i2 = sVar2.b;
|
|
|
|
}
|
|
|
|
j2 += min;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final long f() {
|
|
|
|
long j = this.j;
|
|
|
|
if (j == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s sVar2 = sVar.g;
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i = sVar2.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
if (i < 8192 && sVar2.e) {
|
|
|
|
j -= (long) (i - sVar2.b);
|
|
|
|
}
|
|
|
|
return j;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink, g0.v, java.io.Flushable
|
|
|
|
public void flush() {
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g, okio.BufferedSink
|
|
|
|
public e g() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public int hashCode() {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
int i = 1;
|
|
|
|
do {
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
for (int i3 = sVar.b; i3 < i2; i3++) {
|
|
|
|
i = (i * 31) + sVar.a[i3];
|
|
|
|
}
|
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
} while (sVar != this.i);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
@Override // g0.x
|
|
|
|
public long i0(e eVar, long j) {
|
|
|
|
m.checkParameterIsNotNull(eVar, "sink");
|
|
|
|
if (j >= 0) {
|
|
|
|
long j2 = this.j;
|
|
|
|
if (j2 == 0) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (j > j2) {
|
|
|
|
j = j2;
|
|
|
|
}
|
|
|
|
eVar.write(this, j);
|
|
|
|
return j;
|
|
|
|
}
|
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.s("byteCount < 0: ", j).toString());
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // java.nio.channels.Channel
|
|
|
|
public boolean isOpen() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public boolean j(long j) {
|
|
|
|
return this.j >= j;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
2021-11-05 06:48:17 +00:00
|
|
|
public long k0(v vVar) throws IOException {
|
2021-11-02 06:38:17 +00:00
|
|
|
m.checkParameterIsNotNull(vVar, "sink");
|
|
|
|
long j = this.j;
|
|
|
|
if (j > 0) {
|
|
|
|
vVar.write(this, j);
|
|
|
|
}
|
|
|
|
return j;
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
public final e n(e eVar, long j, long j2) {
|
2021-11-02 06:38:17 +00:00
|
|
|
m.checkParameterIsNotNull(eVar, "out");
|
2021-11-05 06:48:17 +00:00
|
|
|
f.w(this.j, j, j2);
|
2021-11-02 06:38:17 +00:00
|
|
|
if (j2 != 0) {
|
|
|
|
eVar.j += j2;
|
|
|
|
s sVar = this.i;
|
|
|
|
while (true) {
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
int i2 = sVar.b;
|
|
|
|
if (j < ((long) (i - i2))) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
j -= (long) (i - i2);
|
|
|
|
sVar = sVar.f;
|
|
|
|
}
|
|
|
|
while (j2 > 0) {
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s c2 = sVar.c();
|
|
|
|
int i3 = c2.b + ((int) j);
|
|
|
|
c2.b = i3;
|
2021-11-29 21:56:34 +00:00
|
|
|
c2.f2893c = Math.min(i3 + ((int) j2), c2.f2893c);
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar2 = eVar.i;
|
|
|
|
if (sVar2 == null) {
|
|
|
|
c2.g = c2;
|
|
|
|
c2.f = c2;
|
|
|
|
eVar.i = c2;
|
|
|
|
} else {
|
|
|
|
if (sVar2 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s sVar3 = sVar2.g;
|
|
|
|
if (sVar3 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar3.b(c2);
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j2 -= (long) (c2.f2893c - c2.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
j = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
@Override // g0.g
|
|
|
|
public ByteString o(long j) throws EOFException {
|
|
|
|
if (!(j >= 0 && j <= ((long) Integer.MAX_VALUE))) {
|
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.s("byteCount: ", j).toString());
|
|
|
|
} else if (this.j < j) {
|
|
|
|
throw new EOFException();
|
|
|
|
} else if (j < ((long) 4096)) {
|
|
|
|
return new ByteString(Z(j));
|
|
|
|
} else {
|
|
|
|
ByteString J = J((int) j);
|
|
|
|
skip(j);
|
|
|
|
return J;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public BufferedSink p() {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public void p0(long j) throws EOFException {
|
|
|
|
if (this.j < j) {
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public final byte q(long j) {
|
|
|
|
f.w(this.j, j, 1);
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar != null) {
|
|
|
|
long j2 = this.j;
|
|
|
|
if (j2 - j < j) {
|
|
|
|
while (j2 > j) {
|
|
|
|
sVar = sVar.g;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j2 -= (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
return sVar.a[(int) ((((long) sVar.b) + j) - j2)];
|
|
|
|
}
|
|
|
|
long j3 = 0;
|
|
|
|
while (true) {
|
2021-11-29 21:56:34 +00:00
|
|
|
int i = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
int i2 = sVar.b;
|
|
|
|
long j4 = ((long) (i - i2)) + j3;
|
|
|
|
if (j4 > j) {
|
|
|
|
return sVar.a[(int) ((((long) i2) + j) - j3)];
|
|
|
|
}
|
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j3 = j4;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
m.throwNpe();
|
|
|
|
throw null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.nio.channels.ReadableByteChannel
|
|
|
|
public int read(ByteBuffer byteBuffer) throws IOException {
|
|
|
|
m.checkParameterIsNotNull(byteBuffer, "sink");
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
return -1;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int min = Math.min(byteBuffer.remaining(), sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
byteBuffer.put(sVar.a, sVar.b, min);
|
|
|
|
int i = sVar.b + min;
|
|
|
|
sVar.b = i;
|
|
|
|
this.j -= (long) min;
|
2021-11-29 21:56:34 +00:00
|
|
|
if (i == sVar.f2893c) {
|
2021-11-02 06:38:17 +00:00
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
}
|
|
|
|
return min;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int read(byte[] bArr, int i, int i2) {
|
|
|
|
m.checkParameterIsNotNull(bArr, "sink");
|
2021-11-05 06:48:17 +00:00
|
|
|
f.w((long) bArr.length, (long) i, (long) i2);
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
return -1;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int min = Math.min(i2, sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
byte[] bArr2 = sVar.a;
|
|
|
|
int i3 = sVar.b;
|
|
|
|
j.copyInto(bArr2, bArr, i, i3, i3 + min);
|
|
|
|
int i4 = sVar.b + min;
|
|
|
|
sVar.b = i4;
|
|
|
|
this.j -= (long) min;
|
2021-11-29 21:56:34 +00:00
|
|
|
if (i4 != sVar.f2893c) {
|
2021-11-02 06:38:17 +00:00
|
|
|
return min;
|
|
|
|
}
|
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
return min;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public byte readByte() throws EOFException {
|
|
|
|
if (this.j != 0) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
int i = sVar.b;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
int i3 = i + 1;
|
|
|
|
byte b2 = sVar.a[i];
|
|
|
|
this.j--;
|
|
|
|
if (i3 == i2) {
|
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
} else {
|
|
|
|
sVar.b = i3;
|
|
|
|
}
|
|
|
|
return b2;
|
|
|
|
}
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public void readFully(byte[] bArr) throws EOFException {
|
|
|
|
m.checkParameterIsNotNull(bArr, "sink");
|
|
|
|
int i = 0;
|
|
|
|
while (i < bArr.length) {
|
|
|
|
int read = read(bArr, i, bArr.length - i);
|
|
|
|
if (read != -1) {
|
|
|
|
i += read;
|
|
|
|
} else {
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public int readInt() throws EOFException {
|
|
|
|
if (this.j >= 4) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
int i = sVar.b;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
if (((long) (i2 - i)) < 4) {
|
|
|
|
return ((readByte() & 255) << 24) | ((readByte() & 255) << 16) | ((readByte() & 255) << 8) | (readByte() & 255);
|
|
|
|
}
|
|
|
|
byte[] bArr = sVar.a;
|
|
|
|
int i3 = i + 1;
|
|
|
|
int i4 = i3 + 1;
|
|
|
|
int i5 = ((bArr[i] & 255) << 24) | ((bArr[i3] & 255) << 16);
|
|
|
|
int i6 = i4 + 1;
|
|
|
|
int i7 = i5 | ((bArr[i4] & 255) << 8);
|
|
|
|
int i8 = i6 + 1;
|
|
|
|
int i9 = i7 | (bArr[i6] & 255);
|
|
|
|
this.j -= 4;
|
|
|
|
if (i8 == i2) {
|
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
} else {
|
|
|
|
sVar.b = i8;
|
|
|
|
}
|
|
|
|
return i9;
|
|
|
|
}
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public long readLong() throws EOFException {
|
|
|
|
if (this.j >= 8) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
int i = sVar.b;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
if (((long) (i2 - i)) < 8) {
|
|
|
|
return ((((long) readInt()) & 4294967295L) << 32) | (4294967295L & ((long) readInt()));
|
|
|
|
}
|
|
|
|
byte[] bArr = sVar.a;
|
|
|
|
int i3 = i + 1;
|
|
|
|
int i4 = i3 + 1;
|
|
|
|
int i5 = i4 + 1;
|
|
|
|
long j = ((((long) bArr[i]) & 255) << 56) | ((((long) bArr[i3]) & 255) << 48) | ((((long) bArr[i4]) & 255) << 40);
|
|
|
|
int i6 = i5 + 1;
|
|
|
|
long j2 = ((((long) bArr[i5]) & 255) << 32) | j;
|
|
|
|
int i7 = i6 + 1;
|
|
|
|
int i8 = i7 + 1;
|
|
|
|
long j3 = j2 | ((((long) bArr[i6]) & 255) << 24) | ((((long) bArr[i7]) & 255) << 16);
|
|
|
|
int i9 = i8 + 1;
|
|
|
|
int i10 = i9 + 1;
|
|
|
|
long j4 = j3 | ((((long) bArr[i8]) & 255) << 8) | (((long) bArr[i9]) & 255);
|
|
|
|
this.j -= 8;
|
|
|
|
if (i10 == i2) {
|
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
} else {
|
|
|
|
sVar.b = i10;
|
|
|
|
}
|
|
|
|
return j4;
|
|
|
|
}
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public short readShort() throws EOFException {
|
|
|
|
if (this.j >= 2) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
int i = sVar.b;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
if (i2 - i < 2) {
|
|
|
|
return (short) (((readByte() & 255) << 8) | (readByte() & 255));
|
|
|
|
}
|
|
|
|
byte[] bArr = sVar.a;
|
|
|
|
int i3 = i + 1;
|
|
|
|
int i4 = i3 + 1;
|
|
|
|
int i5 = ((bArr[i] & 255) << 8) | (bArr[i3] & 255);
|
|
|
|
this.j -= 2;
|
|
|
|
if (i4 == i2) {
|
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
} else {
|
|
|
|
sVar.b = i4;
|
|
|
|
}
|
|
|
|
return (short) i5;
|
|
|
|
}
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public long s(byte b2, long j, long j2) {
|
|
|
|
s sVar;
|
|
|
|
long j3 = 0;
|
|
|
|
if (0 <= j && j2 >= j) {
|
|
|
|
long j4 = this.j;
|
|
|
|
if (j2 > j4) {
|
|
|
|
j2 = j4;
|
|
|
|
}
|
|
|
|
if (!(j == j2 || (sVar = this.i) == null)) {
|
|
|
|
if (j4 - j < j) {
|
|
|
|
while (j4 > j) {
|
|
|
|
sVar = sVar.g;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j4 -= (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
while (j4 < j2) {
|
|
|
|
byte[] bArr = sVar.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int min = (int) Math.min((long) sVar.f2893c, (((long) sVar.b) + j2) - j4);
|
2021-11-02 06:38:17 +00:00
|
|
|
for (int i = (int) ((((long) sVar.b) + j) - j4); i < min; i++) {
|
|
|
|
if (bArr[i] == b2) {
|
|
|
|
return ((long) (i - sVar.b)) + j4;
|
|
|
|
}
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j4 += (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j = j4;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
while (true) {
|
2021-11-29 21:56:34 +00:00
|
|
|
long j5 = ((long) (sVar.f2893c - sVar.b)) + j3;
|
2021-11-02 06:38:17 +00:00
|
|
|
if (j5 > j) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j3 = j5;
|
|
|
|
}
|
|
|
|
while (j3 < j2) {
|
|
|
|
byte[] bArr2 = sVar.a;
|
2021-11-29 21:56:34 +00:00
|
|
|
int min2 = (int) Math.min((long) sVar.f2893c, (((long) sVar.b) + j2) - j3);
|
2021-11-02 06:38:17 +00:00
|
|
|
for (int i2 = (int) ((((long) sVar.b) + j) - j3); i2 < min2; i2++) {
|
|
|
|
if (bArr2[i2] == b2) {
|
|
|
|
return ((long) (i2 - sVar.b)) + j3;
|
|
|
|
}
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j3 += (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j = j3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder R = c.d.b.a.a.R("size=");
|
|
|
|
R.append(this.j);
|
|
|
|
R.append(" fromIndex=");
|
|
|
|
R.append(j);
|
|
|
|
R.append(" toIndex=");
|
|
|
|
R.append(j2);
|
|
|
|
throw new IllegalArgumentException(R.toString().toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public long s0() throws EOFException {
|
|
|
|
byte b2;
|
|
|
|
int i;
|
|
|
|
if (this.j != 0) {
|
|
|
|
int i2 = 0;
|
|
|
|
boolean z2 = false;
|
|
|
|
long j = 0;
|
|
|
|
do {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
byte[] bArr = sVar.a;
|
|
|
|
int i3 = sVar.b;
|
2021-11-29 21:56:34 +00:00
|
|
|
int i4 = sVar.f2893c;
|
2021-11-05 06:48:17 +00:00
|
|
|
while (true) {
|
|
|
|
if (i3 >= i4) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
b2 = bArr[i3];
|
|
|
|
byte b3 = (byte) 48;
|
|
|
|
if (b2 < b3 || b2 > ((byte) 57)) {
|
|
|
|
byte b4 = (byte) 97;
|
|
|
|
if ((b2 < b4 || b2 > ((byte) 102)) && (b2 < (b4 = (byte) 65) || b2 > ((byte) 70))) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
i = (b2 - b4) + 10;
|
|
|
|
} else {
|
|
|
|
i = b2 - b3;
|
|
|
|
}
|
|
|
|
if ((-1152921504606846976L & j) == 0) {
|
|
|
|
j = (j << 4) | ((long) i);
|
|
|
|
i3++;
|
|
|
|
i2++;
|
|
|
|
} else {
|
|
|
|
e eVar = new e();
|
|
|
|
eVar.Q(j);
|
|
|
|
eVar.T(b2);
|
|
|
|
StringBuilder R = c.d.b.a.a.R("Number too large: ");
|
|
|
|
R.append(eVar.D());
|
|
|
|
throw new NumberFormatException(R.toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i2 != 0) {
|
|
|
|
z2 = true;
|
|
|
|
if (i3 == i4) {
|
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
} else {
|
|
|
|
sVar.b = i3;
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
StringBuilder R2 = c.d.b.a.a.R("Expected leading [0-9a-fA-F] character but was 0x");
|
|
|
|
R2.append(f.c1(b2));
|
|
|
|
throw new NumberFormatException(R2.toString());
|
|
|
|
}
|
|
|
|
} while (this.i != null);
|
|
|
|
this.j -= (long) i2;
|
|
|
|
return j;
|
|
|
|
}
|
|
|
|
throw new EOFException();
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public void skip(long j) throws EOFException {
|
|
|
|
while (j > 0) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar != null) {
|
2021-11-29 21:56:34 +00:00
|
|
|
int min = (int) Math.min(j, (long) (sVar.f2893c - sVar.b));
|
2021-11-02 06:38:17 +00:00
|
|
|
long j2 = (long) min;
|
|
|
|
this.j -= j2;
|
|
|
|
j -= j2;
|
|
|
|
int i = sVar.b + min;
|
|
|
|
sVar.b = i;
|
2021-11-29 21:56:34 +00:00
|
|
|
if (i == sVar.f2893c) {
|
2021-11-02 06:38:17 +00:00
|
|
|
this.i = sVar.a();
|
|
|
|
t.a(sVar);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw new EOFException();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public long t(ByteString byteString, long j) {
|
|
|
|
int i;
|
|
|
|
int i2;
|
|
|
|
int i3;
|
|
|
|
int i4;
|
|
|
|
long j2 = j;
|
|
|
|
m.checkParameterIsNotNull(byteString, "targetBytes");
|
|
|
|
long j3 = 0;
|
|
|
|
if (j2 >= 0) {
|
|
|
|
s sVar = this.i;
|
|
|
|
if (sVar == null) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
long j4 = this.j;
|
|
|
|
if (j4 - j2 < j2) {
|
|
|
|
while (j4 > j2) {
|
|
|
|
sVar = sVar.g;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j4 -= (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
if (byteString.j() == 2) {
|
|
|
|
byte m = byteString.m(0);
|
|
|
|
byte m2 = byteString.m(1);
|
|
|
|
while (j4 < this.j) {
|
|
|
|
byte[] bArr = sVar.a;
|
|
|
|
i3 = (int) ((((long) sVar.b) + j2) - j4);
|
2021-11-29 21:56:34 +00:00
|
|
|
int i5 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
while (i3 < i5) {
|
|
|
|
byte b2 = bArr[i3];
|
|
|
|
if (b2 == m || b2 == m2) {
|
|
|
|
i4 = sVar.b;
|
|
|
|
} else {
|
|
|
|
i3++;
|
|
|
|
}
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j4 += (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j2 = j4;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
byte[] l = byteString.l();
|
|
|
|
while (j4 < this.j) {
|
|
|
|
byte[] bArr2 = sVar.a;
|
|
|
|
i3 = (int) ((((long) sVar.b) + j2) - j4);
|
2021-11-29 21:56:34 +00:00
|
|
|
int i6 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
while (i3 < i6) {
|
|
|
|
byte b3 = bArr2[i3];
|
|
|
|
for (byte b4 : l) {
|
|
|
|
if (b3 == b4) {
|
|
|
|
i4 = sVar.b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i3++;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j4 += (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j2 = j4;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
return ((long) (i3 - i4)) + j4;
|
|
|
|
}
|
|
|
|
while (true) {
|
2021-11-29 21:56:34 +00:00
|
|
|
long j5 = ((long) (sVar.f2893c - sVar.b)) + j3;
|
2021-11-02 06:38:17 +00:00
|
|
|
if (j5 > j2) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j3 = j5;
|
|
|
|
}
|
|
|
|
if (byteString.j() == 2) {
|
|
|
|
byte m3 = byteString.m(0);
|
|
|
|
byte m4 = byteString.m(1);
|
|
|
|
while (j3 < this.j) {
|
|
|
|
byte[] bArr3 = sVar.a;
|
|
|
|
i = (int) ((((long) sVar.b) + j2) - j3);
|
2021-11-29 21:56:34 +00:00
|
|
|
int i7 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
while (i < i7) {
|
|
|
|
byte b5 = bArr3[i];
|
|
|
|
if (b5 == m3 || b5 == m4) {
|
|
|
|
i2 = sVar.b;
|
|
|
|
} else {
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j3 += (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j2 = j3;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
byte[] l2 = byteString.l();
|
|
|
|
while (j3 < this.j) {
|
|
|
|
byte[] bArr4 = sVar.a;
|
|
|
|
i = (int) ((((long) sVar.b) + j2) - j3);
|
2021-11-29 21:56:34 +00:00
|
|
|
int i8 = sVar.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
while (i < i8) {
|
|
|
|
byte b6 = bArr4[i];
|
|
|
|
for (byte b7 : l2) {
|
|
|
|
if (b6 == b7) {
|
|
|
|
i2 = sVar.b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
j3 += (long) (sVar.f2893c - sVar.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar = sVar.f;
|
|
|
|
if (sVar == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
j2 = j3;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
return ((long) (i - i2)) + j3;
|
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalArgumentException(c.d.b.a.a.s("fromIndex < 0: ", j2).toString());
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.x
|
|
|
|
public y timeout() {
|
|
|
|
return y.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.lang.Object
|
|
|
|
public String toString() {
|
|
|
|
long j = this.j;
|
|
|
|
if (j <= ((long) Integer.MAX_VALUE)) {
|
2021-11-05 06:48:17 +00:00
|
|
|
return J((int) j).toString();
|
|
|
|
}
|
|
|
|
StringBuilder R = c.d.b.a.a.R("size > Int.MAX_VALUE: ");
|
|
|
|
R.append(this.j);
|
|
|
|
throw new IllegalStateException(R.toString().toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
public final a u(a aVar) {
|
|
|
|
m.checkParameterIsNotNull(aVar, "unsafeCursor");
|
|
|
|
if (aVar.i == null) {
|
|
|
|
aVar.i = this;
|
|
|
|
aVar.j = true;
|
|
|
|
return aVar;
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
2021-11-05 06:48:17 +00:00
|
|
|
throw new IllegalStateException("already attached to a buffer".toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
|
|
|
public InputStream u0() {
|
|
|
|
return new b(this);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
2021-11-05 06:48:17 +00:00
|
|
|
public int v0(o oVar) {
|
2021-11-02 06:38:17 +00:00
|
|
|
m.checkParameterIsNotNull(oVar, "options");
|
|
|
|
int b2 = g0.z.a.b(this, oVar, false);
|
|
|
|
if (b2 == -1) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
skip((long) oVar.k[b2].j());
|
|
|
|
return b2;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.g
|
2021-11-05 06:48:17 +00:00
|
|
|
public boolean w() {
|
2021-11-02 06:38:17 +00:00
|
|
|
return this.j == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.nio.channels.WritableByteChannel
|
|
|
|
public int write(ByteBuffer byteBuffer) throws IOException {
|
|
|
|
m.checkParameterIsNotNull(byteBuffer, "source");
|
|
|
|
int remaining = byteBuffer.remaining();
|
|
|
|
int i = remaining;
|
|
|
|
while (i > 0) {
|
|
|
|
s N = N(1);
|
2021-11-29 21:56:34 +00:00
|
|
|
int min = Math.min(i, 8192 - N.f2893c);
|
|
|
|
byteBuffer.get(N.a, N.f2893c, min);
|
2021-11-02 06:38:17 +00:00
|
|
|
i -= min;
|
2021-11-29 21:56:34 +00:00
|
|
|
N.f2893c += min;
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
this.j += (long) remaining;
|
|
|
|
return remaining;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public /* bridge */ /* synthetic */ BufferedSink write(byte[] bArr) {
|
|
|
|
R(bArr);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public /* bridge */ /* synthetic */ BufferedSink write(byte[] bArr, int i, int i2) {
|
|
|
|
S(bArr, i, i2);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // g0.v
|
|
|
|
public void write(e eVar, long j) {
|
|
|
|
int i;
|
|
|
|
s sVar;
|
|
|
|
s sVar2;
|
|
|
|
m.checkParameterIsNotNull(eVar, "source");
|
|
|
|
if (eVar != this) {
|
2021-11-05 06:48:17 +00:00
|
|
|
f.w(eVar.j, 0, j);
|
2021-11-02 06:38:17 +00:00
|
|
|
long j2 = j;
|
|
|
|
while (j2 > 0) {
|
|
|
|
s sVar3 = eVar.i;
|
|
|
|
if (sVar3 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i2 = sVar3.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar4 = eVar.i;
|
|
|
|
if (sVar4 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
if (j2 < ((long) (i2 - sVar4.b))) {
|
|
|
|
s sVar5 = this.i;
|
|
|
|
if (sVar5 != null) {
|
|
|
|
if (sVar5 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar = sVar5.g;
|
|
|
|
} else {
|
|
|
|
sVar = null;
|
|
|
|
}
|
|
|
|
if (sVar != null && sVar.e) {
|
2021-11-29 21:56:34 +00:00
|
|
|
if ((((long) sVar.f2893c) + j2) - ((long) (sVar.d ? 0 : sVar.b)) <= ((long) 8192)) {
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar6 = eVar.i;
|
|
|
|
if (sVar6 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar6.d(sVar, (int) j2);
|
|
|
|
eVar.j -= j2;
|
|
|
|
this.j += j2;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s sVar7 = eVar.i;
|
|
|
|
if (sVar7 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
int i3 = (int) j2;
|
|
|
|
Objects.requireNonNull(sVar7);
|
2021-11-29 21:56:34 +00:00
|
|
|
if (i3 > 0 && i3 <= sVar7.f2893c - sVar7.b) {
|
2021-11-02 06:38:17 +00:00
|
|
|
if (i3 >= 1024) {
|
|
|
|
sVar2 = sVar7.c();
|
|
|
|
} else {
|
|
|
|
sVar2 = t.b();
|
|
|
|
byte[] bArr = sVar7.a;
|
|
|
|
byte[] bArr2 = sVar2.a;
|
|
|
|
int i4 = sVar7.b;
|
|
|
|
j.copyInto$default(bArr, bArr2, 0, i4, i4 + i3, 2, (Object) null);
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
sVar2.f2893c = sVar2.b + i3;
|
2021-11-02 06:38:17 +00:00
|
|
|
sVar7.b += i3;
|
|
|
|
s sVar8 = sVar7.g;
|
|
|
|
if (sVar8 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar8.b(sVar2);
|
|
|
|
eVar.i = sVar2;
|
|
|
|
} else {
|
|
|
|
throw new IllegalArgumentException("byteCount out of range".toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s sVar9 = eVar.i;
|
|
|
|
if (sVar9 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
long j3 = (long) (sVar9.f2893c - sVar9.b);
|
2021-11-02 06:38:17 +00:00
|
|
|
eVar.i = sVar9.a();
|
|
|
|
s sVar10 = this.i;
|
|
|
|
if (sVar10 == null) {
|
|
|
|
this.i = sVar9;
|
|
|
|
sVar9.g = sVar9;
|
|
|
|
sVar9.f = sVar9;
|
|
|
|
} else {
|
|
|
|
if (sVar10 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
s sVar11 = sVar10.g;
|
|
|
|
if (sVar11 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar11.b(sVar9);
|
|
|
|
s sVar12 = sVar9.g;
|
|
|
|
if (sVar12 != sVar9) {
|
|
|
|
if (sVar12 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
if (sVar12.e) {
|
2021-11-29 21:56:34 +00:00
|
|
|
int i5 = sVar9.f2893c - sVar9.b;
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar13 = sVar9.g;
|
|
|
|
if (sVar13 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
2021-11-29 21:56:34 +00:00
|
|
|
int i6 = 8192 - sVar13.f2893c;
|
2021-11-02 06:38:17 +00:00
|
|
|
s sVar14 = sVar9.g;
|
|
|
|
if (sVar14 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
if (sVar14.d) {
|
|
|
|
i = 0;
|
|
|
|
} else {
|
|
|
|
s sVar15 = sVar9.g;
|
|
|
|
if (sVar15 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
i = sVar15.b;
|
|
|
|
}
|
|
|
|
if (i5 <= i6 + i) {
|
|
|
|
s sVar16 = sVar9.g;
|
|
|
|
if (sVar16 == null) {
|
|
|
|
m.throwNpe();
|
|
|
|
}
|
|
|
|
sVar9.d(sVar16, i5);
|
|
|
|
sVar9.a();
|
|
|
|
t.a(sVar9);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("cannot compact".toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eVar.j -= j3;
|
|
|
|
this.j += j3;
|
|
|
|
j2 -= j3;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
throw new IllegalArgumentException("source == this".toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public /* bridge */ /* synthetic */ BufferedSink writeByte(int i) {
|
|
|
|
T(i);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public /* bridge */ /* synthetic */ BufferedSink writeInt(int i) {
|
|
|
|
W(i);
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okio.BufferedSink
|
|
|
|
public /* bridge */ /* synthetic */ BufferedSink writeShort(int i) {
|
2021-11-05 06:48:17 +00:00
|
|
|
X(i);
|
2021-11-02 06:38:17 +00:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ByteString x() {
|
2021-11-05 06:48:17 +00:00
|
|
|
return o(this.j);
|
2021-11-02 06:38:17 +00:00
|
|
|
}
|
|
|
|
|
2021-11-05 06:48:17 +00:00
|
|
|
public short y() throws EOFException {
|
2021-11-02 06:38:17 +00:00
|
|
|
int readShort = readShort() & 65535;
|
|
|
|
return (short) (((readShort & 255) << 8) | ((65280 & readShort) >>> 8));
|
|
|
|
}
|
|
|
|
}
|