Class 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 Detail

      • CucTimeDecoder

        public CucTimeDecoder​(int implicitPField)
        Constructor for decoder.
        Parameters:
        implicitPField - -1 means is part of the packet, other values means it is pre-defined (implicit)
    • 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, an ArrayIndexOutOfBoundsException will be thrown.
        Specified by:
        decode in interface TimeDecoder
        Parameters:
        packet - - where to read the data from
        offset - - 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 interface TimeDecoder
        Parameters:
        s - - the bytes will be read from here.
        Returns:
        time in milliseconds