forked from KNEMC/KLALB
KLALB完全大重写,代码规范了,可以当作网络库使用
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user