All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.yamcs.time.TimeDecoder Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.time;

import org.yamcs.tctm.PacketPreprocessor;

/**
 * Interface for time decoders used in the {@link PacketPreprocessor}
 * 
 */
public 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 {@link ArrayIndexOutOfBoundsException} will be * thrown. * * @param buf * - where to read the data from * @param offset * - offset in the buffer where the decoding will begin * @return decoded time in milliseconds * */ public long decode(byte[] buf, int offset); /** * 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 {@link ArrayIndexOutOfBoundsException} will be * thrown. * * @param buf * - where to read the data from * * @param offset * - offset in the buffer where the decoding will begin * @return time * */ public long decodeRaw(byte[] buf, int offset); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy