108 lines
2.4 KiB
Java
108 lines
2.4 KiB
Java
import java.io.IOException;
|
|
import java.net.Socket;
|
|
import net.runelite.mapping.Export;
|
|
import net.runelite.mapping.Implements;
|
|
import net.runelite.mapping.ObfuscatedName;
|
|
import net.runelite.mapping.ObfuscatedSignature;
|
|
|
|
@ObfuscatedName("kg")
|
|
@Implements("BufferedNetSocket")
|
|
public class BufferedNetSocket extends AbstractSocket {
|
|
@ObfuscatedName("a")
|
|
@Export("socket")
|
|
Socket socket;
|
|
@ObfuscatedName("t")
|
|
@ObfuscatedSignature(
|
|
signature = "Lkl;"
|
|
)
|
|
@Export("source")
|
|
BufferedSource source;
|
|
@ObfuscatedName("n")
|
|
@ObfuscatedSignature(
|
|
signature = "Lkn;"
|
|
)
|
|
@Export("sink")
|
|
BufferedSink sink;
|
|
|
|
BufferedNetSocket(Socket var1, int var2, int var3) throws IOException {
|
|
this.socket = var1;
|
|
this.socket.setSoTimeout(30000);
|
|
this.socket.setTcpNoDelay(true);
|
|
this.socket.setReceiveBufferSize(65536);
|
|
this.socket.setSendBufferSize(65536);
|
|
this.source = new BufferedSource(this.socket.getInputStream(), var2);
|
|
this.sink = new BufferedSink(this.socket.getOutputStream(), var3);
|
|
}
|
|
|
|
@ObfuscatedName("a")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)V",
|
|
garbageValue = "1632517280"
|
|
)
|
|
@Export("close")
|
|
public void close() {
|
|
this.sink.close();
|
|
|
|
try {
|
|
this.socket.close();
|
|
} catch (IOException var2) {
|
|
}
|
|
|
|
this.source.close();
|
|
}
|
|
|
|
@ObfuscatedName("t")
|
|
@ObfuscatedSignature(
|
|
signature = "(B)I",
|
|
garbageValue = "0"
|
|
)
|
|
@Export("readUnsignedByte")
|
|
public int readUnsignedByte() throws IOException {
|
|
return this.source.readUnsignedByte();
|
|
}
|
|
|
|
@ObfuscatedName("n")
|
|
@ObfuscatedSignature(
|
|
signature = "(B)I",
|
|
garbageValue = "-1"
|
|
)
|
|
@Export("available")
|
|
public int available() throws IOException {
|
|
return this.source.available();
|
|
}
|
|
|
|
@ObfuscatedName("q")
|
|
@ObfuscatedSignature(
|
|
signature = "(II)Z",
|
|
garbageValue = "1174929907"
|
|
)
|
|
@Export("isAvailable")
|
|
public boolean isAvailable(int var1) throws IOException {
|
|
return this.source.isAvailable(var1);
|
|
}
|
|
|
|
@ObfuscatedName("v")
|
|
@ObfuscatedSignature(
|
|
signature = "([BIII)I",
|
|
garbageValue = "1681485484"
|
|
)
|
|
@Export("read")
|
|
public int read(byte[] var1, int var2, int var3) throws IOException {
|
|
return this.source.read(var1, var2, var3);
|
|
}
|
|
|
|
@ObfuscatedName("c")
|
|
@ObfuscatedSignature(
|
|
signature = "([BIII)V",
|
|
garbageValue = "1989353375"
|
|
)
|
|
@Export("write")
|
|
public void write(byte[] var1, int var2, int var3) throws IOException {
|
|
this.sink.write(var1, var2, var3);
|
|
}
|
|
|
|
protected void finalize() {
|
|
this.close();
|
|
}
|
|
}
|