@@ -0,0 +1,1990 @@
+package com.checkers.kingme.comp474checkers.network.kmp;%0A%0Aimport java.io.*;%0Aimport java.util.Arrays;%0A%0A/**%0A * Created by Carlos%0A */%0Apublic class KMPMove extends BaseKMPPacket %7B%0A%0A    public static final byte OPCODE = MOVop;%0A%0A    private byte%5B%5D move;%0A%0A    public KMPMove(int msgid, int from, char type, int to)%0A    %7B%0A        super(OPCODE, msgid);%0A%0A        this.move = new byte%5B3%5D;%0A%0A        this.move%5B0%5D = (byte)from;%0A        this.move%5B1%5D = (byte)type;%0A        this.move%5B2%5D = (byte)to;%0A    %7D%0A%0A    // constructor to build a packet incoming from the network%0A    public KMPMove(byte%5B%5D buffer, int length) throws IOException%0A    %7B%0A        byte bufopcode;%0A        byte buffrom;%0A        byte buftype;%0A        byte bufto;%0A        short bufmsgid;%0A%0A        ByteArrayInputStream bais = new ByteArrayInputStream(Arrays.copyOf(buffer, length));%0A        DataInputStream dis = new DataInputStream(bais);%0A        bufopcode = dis.readByte();%0A        bufmsgid = dis.readShort();%0A        buffrom = dis.readByte();%0A        buftype = dis.readByte();%0A        bufto = dis.readByte();%0A        if (bufopcode != OPCODE) %7B%0A            throw new IOException(%22Wrong opcode!%22);%0A        %7D%0A%0A        this.opcode = bufopcode;%0A        this.msgid = bufmsgid;%0A%0A        this.move = new byte%5B3%5D;%0A%0A        this.move%5B0%5D = buffrom;%0A        this.move%5B1%5D = buftype;%0A        this.move%5B2%5D = bufto;%0A    %7D%0A%0A    public byte%5B%5D write() throws IOException%0A    %7B%0A        ByteArrayOutputStream baos = new ByteArrayOutputStream(size());%0A        DataOutputStream dos = new DataOutputStream(baos);%0A        dos.writeByte(this.opcode);%0A        dos.writeShort(this.msgid);%0A        dos.write(this.move, 0, 3);%0A        return baos.toByteArray();%0A    %7D%0A%0A    public int size()%0A    %7B%0A        return super.size() + 3; // plus three bytes for the move info%0A    %7D%0A%0A    public int from()%0A    %7B%0A        return (int) move%5B0%5D;%0A    %7D%0A%0A    public char type()%0A    %7B%0A        return (char) move%5B1%5D;%0A    %7D%0A%0A    public int to()%0A    %7B%0A        return (int) move%5B2%5D;%0A    %7D%0A%7D%0A

Create KMPMove.java