KLALB完全大重写,代码规范了,可以当作网络库使用

This commit is contained in:
Administrator
2023-06-23 08:34:15 +08:00
parent 0499ecb34d
commit f743b23e53
154 changed files with 2985 additions and 15058 deletions
@@ -0,0 +1,22 @@
package org.kne.cloud.network.klalb;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Inet6Address;
public class KLALBOutputStream extends DataOutputStream {
public KLALBOutputStream(OutputStream out) throws IOException {
super(out);
byte[]b=new byte[] {'K','L','A','L','B'};
write(b);
writeInt(2);
writeInt(0);
flush();
}
public synchronized void writePacket(KLALBPacket klb) throws IOException {
write(klb.getType());
klb.writeToStream(this);
}
}