104 lines
2.9 KiB
Java
104 lines
2.9 KiB
Java
|
package o;
|
||
|
|
||
|
import java.io.DataInputStream;
|
||
|
import java.io.DataOutputStream;
|
||
|
import java.io.IOException;
|
||
|
import java.io.Serializable;
|
||
|
import java.nio.ByteBuffer;
|
||
|
|
||
|
/* renamed from: o.glT, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public abstract class AbstractC15245glT implements Serializable {
|
||
|
public static final String a = System.getProperty("line.separator");
|
||
|
private glA c;
|
||
|
private final glS d;
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public abstract int e(DataOutputStream dataOutputStream) throws IOException;
|
||
|
|
||
|
public AbstractC15245glT(glS gls) {
|
||
|
this.d = gls;
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static byte[] c(int i) {
|
||
|
int i2 = i > 127 ? i > 255 ? 2 : 1 : 0;
|
||
|
ByteBuffer allocate = ByteBuffer.allocate(i2 + 1);
|
||
|
if (i2 == 0) {
|
||
|
allocate.put(0, (byte) i);
|
||
|
} else {
|
||
|
allocate.put(0, (byte) (i2 + 128));
|
||
|
if (i2 == 1) {
|
||
|
allocate.put(1, (byte) i);
|
||
|
} else {
|
||
|
allocate.putShort(1, (short) i);
|
||
|
}
|
||
|
}
|
||
|
return allocate.array();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static int d(DataInputStream dataInputStream) throws IOException {
|
||
|
int read = dataInputStream.read();
|
||
|
if (read <= 127) {
|
||
|
return read;
|
||
|
}
|
||
|
if ((read & 15) == 1) {
|
||
|
return dataInputStream.readUnsignedByte();
|
||
|
}
|
||
|
return dataInputStream.readShort();
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static byte[] d(Integer num) {
|
||
|
ByteBuffer allocate = ByteBuffer.allocate(4);
|
||
|
allocate.putInt(num.intValue());
|
||
|
return e(allocate.array());
|
||
|
}
|
||
|
|
||
|
/* JADX INFO: Access modifiers changed from: protected */
|
||
|
public static byte[] e(byte[] bArr) {
|
||
|
int i = 0;
|
||
|
boolean z = false;
|
||
|
while (i < bArr.length) {
|
||
|
z = bArr[i] != 0;
|
||
|
if (z) {
|
||
|
break;
|
||
|
}
|
||
|
i++;
|
||
|
}
|
||
|
if (!z) {
|
||
|
return new byte[]{0};
|
||
|
}
|
||
|
byte[] bArr2 = new byte[bArr.length - i];
|
||
|
System.arraycopy(bArr, i, bArr2, 0, bArr.length - i);
|
||
|
return bArr2;
|
||
|
}
|
||
|
|
||
|
public String d(String str) {
|
||
|
return a(str, true);
|
||
|
}
|
||
|
|
||
|
public String a(String str, boolean z) {
|
||
|
StringBuffer stringBuffer = new StringBuffer();
|
||
|
stringBuffer.append(str);
|
||
|
if (z) {
|
||
|
stringBuffer.append(Integer.toHexString(this.d.value)).append(' ');
|
||
|
}
|
||
|
stringBuffer.append(this.d.name()).append(" ");
|
||
|
return stringBuffer.toString();
|
||
|
}
|
||
|
|
||
|
public final void c(glA gla) {
|
||
|
this.c = gla;
|
||
|
}
|
||
|
|
||
|
public final glS b() {
|
||
|
return this.d;
|
||
|
}
|
||
|
|
||
|
public final glA e() {
|
||
|
return this.c;
|
||
|
}
|
||
|
}
|