package art.servers.etdserver.protocols.skp3; import art.library.utils.common.*; import art.servers.etdserver.Shared; public class SKP3_Message { private int[] data; private int pointer = 0; public void setData(byte[] input) { data = new int[input.length]; for (int i=0; i= data.length-1); } public boolean eofCRC() { return (pointer >= data.length-2); } public void check() throws Exception { if (readByte() != SKP3_ProtocolWriter.STX) { throw new Exception(Shared.getMessage("Message not start with 0x7E")); } int S = readByte(); if (S != 'S') { throw new Exception(Shared.getMessage("Message has not S byte of SKP3: " + S)); } int K = readByte(); if (K != 'K') { throw new Exception(Shared.getMessage("Message has not K byte of SKP3: " + K)); } int P = readByte(); if (P != 'P') { throw new Exception(Shared.getMessage("Message has not P byte of SKP3: " + P)); } int V = readByte(); if (V != '3') { throw new Exception(Shared.getMessage("Message has not 3 byte of SKP3: " + V)); } } public byte[] toByteArray() { return(ArrayUtils.toByteArray(data)); } public String toString() { String result = ""; try { for (int i=0; i