Interface TimeDecoder

All Known Implementing Classes:
CucTimeDecoder

public interface TimeDecoder
Interface for time decoders used in the PacketPreprocessor
  • Method Summary

    Modifier and Type
    Method
    Description
    default long
    decode(byte[] buf, int offset)
    Decodes the time from the binary buffer and returns the time in milliseconds.
    long
    decode(ByteSupplier byteSupplier)
    Decodes the time from the packet and returns the time in milliseconds.
    default long
    decodeRaw(byte[] buf, int offset)
     
    long
    decodeRaw(ByteSupplier byteSupplier)
    Returns the time in an unspecified unit.
  • Method Details

    • decode

      long decode(ByteSupplier byteSupplier)
      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)
      Parameters:
      byteSupplier - - the bytes will be read from here.
      Returns:
      time in milliseconds
    • decodeRaw

      long decodeRaw(ByteSupplier byteSupplier)
      Returns the time in an unspecified unit.

      Can be used when the on-board time is free running.

      Parameters:
      byteSupplier - - the bytes will be read from here.
      Returns:
      time
    • decode

      default long decode(byte[] buf, int offset)
      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.
      Parameters:
      buf - - where to read the data from
      offset - - offset in the buffer where the decoding will begin
      Returns:
      decoded time in milliseconds
    • decodeRaw

      default long decodeRaw(byte[] buf, int offset)