discord-jadx/app/src/main/java/g0/s.java

102 lines
2.6 KiB
Java
Raw Normal View History

2021-11-02 06:38:17 +00:00
package g0;
import d0.t.j;
import d0.z.d.m;
/* compiled from: Segment.kt */
2022-03-07 09:34:54 +00:00
/* loaded from: classes3.dex */
2021-11-02 06:38:17 +00:00
public final class s {
public final byte[] a;
2021-12-17 21:59:34 +00:00
/* renamed from: b reason: collision with root package name */
2022-03-28 08:10:50 +00:00
public int f3686b;
2021-12-17 21:59:34 +00:00
public int c;
2021-11-02 06:38:17 +00:00
public boolean d;
public boolean e;
public s f;
public s g;
public s() {
this.a = new byte[8192];
this.e = true;
this.d = false;
}
public s(byte[] bArr, int i, int i2, boolean z2, boolean z3) {
m.checkParameterIsNotNull(bArr, "data");
this.a = bArr;
2022-03-28 08:10:50 +00:00
this.f3686b = i;
2021-12-17 21:59:34 +00:00
this.c = i2;
2021-11-02 06:38:17 +00:00
this.d = z2;
this.e = z3;
}
public final s a() {
s sVar = this.f;
if (sVar == this) {
sVar = null;
}
s sVar2 = this.g;
if (sVar2 == null) {
m.throwNpe();
}
sVar2.f = this.f;
s sVar3 = this.f;
if (sVar3 == null) {
m.throwNpe();
}
sVar3.g = this.g;
this.f = null;
this.g = null;
return sVar;
}
public final s b(s sVar) {
m.checkParameterIsNotNull(sVar, "segment");
sVar.g = this;
sVar.f = this.f;
s sVar2 = this.f;
if (sVar2 == null) {
m.throwNpe();
}
sVar2.g = sVar;
this.f = sVar;
return sVar;
}
public final s c() {
this.d = true;
2022-03-28 08:10:50 +00:00
return new s(this.a, this.f3686b, this.c, true, false);
2021-11-02 06:38:17 +00:00
}
public final void d(s sVar, int i) {
m.checkParameterIsNotNull(sVar, "sink");
if (sVar.e) {
2021-12-17 21:59:34 +00:00
int i2 = sVar.c;
2021-11-02 06:38:17 +00:00
if (i2 + i > 8192) {
if (!sVar.d) {
2022-03-28 08:10:50 +00:00
int i3 = sVar.f3686b;
2021-11-02 06:38:17 +00:00
if ((i2 + i) - i3 <= 8192) {
byte[] bArr = sVar.a;
j.copyInto$default(bArr, bArr, 0, i3, i2, 2, (Object) null);
2022-03-28 08:10:50 +00:00
sVar.c -= sVar.f3686b;
sVar.f3686b = 0;
2021-11-02 06:38:17 +00:00
} else {
throw new IllegalArgumentException();
}
} else {
throw new IllegalArgumentException();
}
}
byte[] bArr2 = this.a;
byte[] bArr3 = sVar.a;
2021-12-17 21:59:34 +00:00
int i4 = sVar.c;
2022-03-28 08:10:50 +00:00
int i5 = this.f3686b;
2021-11-02 06:38:17 +00:00
j.copyInto(bArr2, bArr3, i4, i5, i5 + i);
2021-12-17 21:59:34 +00:00
sVar.c += i;
2022-03-28 08:10:50 +00:00
this.f3686b += i;
2021-11-02 06:38:17 +00:00
return;
}
throw new IllegalStateException("only owner can write".toString());
}
}