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

main
Joseph Gardner 9 years ago
commit 618073d04e

@ -55,6 +55,24 @@ public class RaceClock {
this.lastTime = System.currentTimeMillis();
}
/**
* Sets time to given UTC time in seconds from Unix epoch, preserving timezone.
* @param time UTC time
*/
public void setUTCTime(long time) {
Date utcTime = new Date(time);
setTime(utcTime.toInstant().atZone(this.zoneId));
}
/**
* Get ZonedDateTime corresponding to local time zone and given UTC time.
* @param time
*/
public ZonedDateTime getLocalTime(long time) {
Date utcTime = new Date(time);
return utcTime.toInstant().atZone(this.zoneId);
}
/**
* Updates time by duration elapsed since last update.
*/
@ -68,6 +86,10 @@ public class RaceClock {
return zoneId.toString();
}
public ZonedDateTime getTime() {
return time;
}
public StringProperty timeStringProperty() {
return timeString;
}

@ -148,6 +148,9 @@ public class VisualiserInput implements Runnable
* @throws IOException
*/
private static byte[] getBytes(InputStream inStream) throws IOException {
while (inStream.available() < 15){
//WE NEED THIS!!!!
}
byte[] headerBytes = new byte[15];
inStream.read(headerBytes);
byte[] messageLenBytes = Arrays.copyOfRange(headerBytes, 13, 15);

Loading…
Cancel
Save