Merge remote-tracking branch 'origin/Story30A_InputStreamCheckingHead' into wake_remake

# Conflicts:
#	src/main/java/seng302/models/parsers/StreamPacket.java
#	src/main/java/seng302/models/parsers/StreamParser.java
#	src/main/java/seng302/models/parsers/StreamReceiver.java
This commit is contained in:
Alistair McIntyre
2017-05-01 15:27:51 +12:00
4 changed files with 577 additions and 8 deletions
@@ -50,6 +50,12 @@ public class StreamReceiver extends Thread {
}
public StreamReceiver(Socket host, PriorityBlockingQueue packetBuffer){
this.host=host;
this.packetBuffer = packetBuffer;
}
public void connect(){
try {
stream = host.getInputStream();
@@ -124,8 +130,8 @@ public class StreamReceiver extends Thread {
}
/**
* takes an array of up to 7 bytes and returns a positive
* long constructed from the input bytes
* takes an array of up to 7 bytes in little endian format and
* returns a positive long constructed from the input bytes
*
* @return a positive long if there is less than 7 bytes -1 otherwise
*/
@@ -143,8 +149,6 @@ public class StreamReceiver extends Thread {
}
public static void main(String[] args) {
StreamReceiver sr = new StreamReceiver("csse-s302staff.canterbury.ac.nz", 4941,"TestThread1");