Package org.yamcs.time
Class Float64TimeDecoder
java.lang.Object
org.yamcs.time.Float64TimeDecoder
- All Implemented Interfaces:
TimeDecoder
Decodes milliseconds from fractional seconds stored in a 64-bit float
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Float64TimeDecoder
-
-
Method Details
-
decode
public long decode(byte[] buf, int offset) Description copied from interface:TimeDecoder
Decodes the time from the binary buffer and returns the time in milliseconds. The value returned can be either absolute or relative (this has to be known by the caller)It is assumed that the buffer will contain enough data; if not, an
ArrayIndexOutOfBoundsException
will be thrown.- Specified by:
decode
in interfaceTimeDecoder
- Parameters:
buf
- - where to read the data fromoffset
- - offset in the buffer where the decoding will begin- Returns:
- decoded time in milliseconds
-
decodeRaw
public long decodeRaw(byte[] buf, int offset) Description copied from interface:TimeDecoder
Returns the time in an unspecified unit.Can be used when the on-board time is free running.
It is assumed that the buffer will contain enough data; if not, an
ArrayIndexOutOfBoundsException
will be thrown.- Specified by:
decodeRaw
in interfaceTimeDecoder
- Parameters:
buf
- - where to read the data fromoffset
- - offset in the buffer where the decoding will begin- Returns:
- time
-