KLALB UDP TEST

This commit is contained in:
Administrator
2024-01-30 16:54:09 +08:00
parent 722ab9710f
commit b4fccf3a03
67 changed files with 1977 additions and 929 deletions
@@ -12,11 +12,15 @@ public class KLALBOutputStream extends DataOutputStream {
byte[]b=new byte[] {'K','L','A','L','B'};
write(b);
writeInt(2);
writeInt(0);
writeInt(1);
flush();
}
public synchronized void writePacket(KLALBPacket klb) throws IOException {
write(klb.getType());
klb.writeToStream(this);
public void writePacket(KLALBPacket klb) throws IOException {
writeKLALBPacketToStream(this, klb);
}
public static void writeKLALBPacketToStream(DataOutputStream out,KLALBPacket klb) throws IOException {
out.write(klb.getType());
klb.writeToStream(out);
out.flush();
}
}