Package org.yamcs.tctm.ccsds.time
Class CucTimeDecoder
- java.lang.Object
-
- org.yamcs.tctm.ccsds.time.CucTimeDecoder
-
- All Implemented Interfaces:
TimeDecoder
public class CucTimeDecoder extends Object implements TimeDecoder
Decoder for CCSDS Unsegmented time Code as specified in TIME CODE FORMATS, CCSDS 301.0-B-4, Nov 2010 The time code is composed by- P-Field (preamble field) 8 bits optional
- T-Field - up to 7 bytes (although it could be longer for custom codes)
-
-
Constructor Summary
Constructors Constructor Description CucTimeDecoder(int implicitPField)
Constructor for decoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
decode(byte[] packet, int offset)
Decodes the time from the binary buffer and returns the time in milliseconds.long
decode(ByteSupplier s)
Decodes the time from the packet and returns the time in milliseconds.String
toString()
-
-
-
Method Detail
-
decode
public long decode(byte[] packet, 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, anArrayIndexOutOfBoundsException
will be thrown.- Specified by:
decode
in interfaceTimeDecoder
- Parameters:
packet
- - where to read the data fromoffset
- - offset in the buffer where the decoding will begin- Returns:
- decoded time in milliseconds
-
decode
public long decode(ByteSupplier s)
Description copied from interface:TimeDecoder
Decodes the time from the packet and returns the time in milliseconds. The value returned can be either absolute or relative (this has to be known by the caller)- Specified by:
decode
in interfaceTimeDecoder
- Parameters:
s
- - the bytes will be read from here.- Returns:
- time in milliseconds
-
-