Files
runelite/runescape-client/src/main/java/ByteArrayPool.java
ThatGamerBlue 655106b9df chore: rev 190
2020-06-18 12:15:38 +01:00

127 lines
3.6 KiB
Java

import net.runelite.mapping.Export;
import net.runelite.mapping.Implements;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.Reflection;
@ObfuscatedName("kh")
@Implements("ByteArrayPool")
public class ByteArrayPool {
@ObfuscatedName("m")
@ObfuscatedGetter(
intValue = -1047368171
)
@Export("ByteArrayPool_smallCount")
static int ByteArrayPool_smallCount;
@ObfuscatedName("o")
@ObfuscatedGetter(
intValue = 404509009
)
@Export("ByteArrayPool_mediumCount")
static int ByteArrayPool_mediumCount;
@ObfuscatedName("q")
@ObfuscatedGetter(
intValue = 294344847
)
@Export("ByteArrayPool_largeCount")
static int ByteArrayPool_largeCount;
@ObfuscatedName("j")
@Export("ByteArrayPool_small")
static byte[][] ByteArrayPool_small;
@ObfuscatedName("p")
@Export("ByteArrayPool_medium")
static byte[][] ByteArrayPool_medium;
@ObfuscatedName("g")
@Export("ByteArrayPool_large")
static byte[][] ByteArrayPool_large;
static {
ByteArrayPool_smallCount = 0;
ByteArrayPool_mediumCount = 0;
ByteArrayPool_largeCount = 0;
ByteArrayPool_small = new byte[1000][];
ByteArrayPool_medium = new byte[250][];
ByteArrayPool_large = new byte[50][];
}
@ObfuscatedName("o")
@ObfuscatedSignature(
signature = "(IZI)[B",
garbageValue = "1801183295"
)
@Export("ByteArrayPool_getArrayBool")
static synchronized byte[] ByteArrayPool_getArrayBool(int var0, boolean var1) {
byte[] var2;
if (var0 != 100) {
if (var0 < 100) {
}
} else if (ByteArrayPool_smallCount > 0) {
var2 = ByteArrayPool_small[--ByteArrayPool_smallCount];
ByteArrayPool_small[ByteArrayPool_smallCount] = null;
return var2;
}
if (var0 != 5000) {
if (var0 < 5000) {
}
} else if (ByteArrayPool_mediumCount > 0) {
var2 = ByteArrayPool_medium[--ByteArrayPool_mediumCount];
ByteArrayPool_medium[ByteArrayPool_mediumCount] = null;
return var2;
}
if (var0 != 30000) {
if (var0 < 30000) {
}
} else if (ByteArrayPool_largeCount > 0) {
var2 = ByteArrayPool_large[--ByteArrayPool_largeCount];
ByteArrayPool_large[ByteArrayPool_largeCount] = null;
return var2;
}
if (Fonts.ByteArrayPool_arrays != null) {
for (int var4 = 0; var4 < ParamDefinition.ByteArrayPool_alternativeSizes.length; ++var4) {
if (ParamDefinition.ByteArrayPool_alternativeSizes[var4] != var0) {
if (var0 < ParamDefinition.ByteArrayPool_alternativeSizes[var4]) {
}
} else if (VarbitDefinition.ByteArrayPool_altSizeArrayCounts[var4] > 0) {
byte[] var3 = Fonts.ByteArrayPool_arrays[var4][--VarbitDefinition.ByteArrayPool_altSizeArrayCounts[var4]];
Fonts.ByteArrayPool_arrays[var4][VarbitDefinition.ByteArrayPool_altSizeArrayCounts[var4]] = null;
return var3;
}
}
}
return new byte[var0];
}
@ObfuscatedName("p")
@ObfuscatedSignature(
signature = "(Ljava/lang/String;B)Ljava/lang/Class;",
garbageValue = "28"
)
@Export("loadClassFromDescriptor")
static Class loadClassFromDescriptor(String var0) throws ClassNotFoundException {
if (var0.equals("B")) {
return Byte.TYPE;
} else if (var0.equals("I")) {
return Integer.TYPE;
} else if (var0.equals("S")) {
return Short.TYPE;
} else if (var0.equals("J")) {
return Long.TYPE;
} else if (var0.equals("Z")) {
return Boolean.TYPE;
} else if (var0.equals("F")) {
return Float.TYPE;
} else if (var0.equals("D")) {
return Double.TYPE;
} else if (var0.equals("C")) {
return Character.TYPE;
} else {
return var0.equals("void") ? Void.TYPE : Reflection.findClass(var0);
}
}
}