Merge remote-tracking branch 'remotes/origin/splitIntoTwoModules' into NetworkedVisualiser

# Conflicts:
#	visualiser/src/main/java/seng302/VisualiserInput.java
This commit is contained in:
cbt24
2017-05-01 15:55:19 +12:00
8 changed files with 573 additions and 34 deletions
@@ -8,6 +8,7 @@ import java.nio.ByteOrder;
import java.util.Arrays;
import static seng302.Networking.Utils.ByteConverter.bytesToLong;
import static seng302.Networking.Utils.ByteConverter.bytesToShort;
/**
* Created by hba56 on 20/04/17.
@@ -45,15 +46,6 @@ public class XMLMessageDecoder {
this.xmlMessage = new String(xmlMessagebytes);
}
private short bytesToShort(byte[] bytesShort){
ByteBuffer byteBuffer = ByteBuffer.allocate(2);
byteBuffer.order(ByteOrder.LITTLE_ENDIAN);
byteBuffer.put(bytesShort[0]);
byteBuffer.put(bytesShort[1]);
short shortVal = byteBuffer.getShort(0);
return shortVal;
}
public byte getMessageVersionNumber() {
return messageVersionNumber;
}
@@ -83,7 +75,7 @@ public class XMLMessageDecoder {
* @return xml string as inputsource
*/
public InputSource getXmlMessageInputSource() {
InputSource is = new InputSource(new StringReader(xmlMessage));
InputSource is = new InputSource(new StringReader(xmlMessage.trim()));
return is;
}