Add preliminary net code
This commit is contained in:
@@ -7,28 +7,15 @@ import java.io.IOException;
|
||||
import com.flaremicro.crossjeeves.net.NetworkHandler;
|
||||
|
||||
public class Packet127KeepAlive extends Packet{
|
||||
long fileId;
|
||||
short chunkSize;
|
||||
byte[] fileChunk;
|
||||
|
||||
public Packet127KeepAlive(){
|
||||
}
|
||||
|
||||
public Packet127KeepAlive(long fileId, byte[] fileChunk){
|
||||
this.fileId = fileId;
|
||||
this.chunkSize = (short)fileChunk.length;
|
||||
this.fileChunk = fileChunk;
|
||||
}
|
||||
|
||||
public void recievePacket(DataInputStream in) throws IOException {
|
||||
fileId = in.readLong();
|
||||
}
|
||||
|
||||
public void sendPacket(DataOutputStream out) throws IOException {
|
||||
super.sendPacket(out);
|
||||
out.writeLong(fileId);
|
||||
out.writeShort(chunkSize);
|
||||
out.write(fileChunk);
|
||||
}
|
||||
|
||||
public void processPacket(NetworkHandler networkHandler){
|
||||
|
||||
Reference in New Issue
Block a user