Package org.yamcs.tctm.ccsds.time
Class CucTimeEncoder
java.lang.Object
org.yamcs.tctm.ccsds.time.CucTimeEncoder
- All Implemented Interfaces:
TimeEncoder
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCucTimeEncoder
(int pfield1, boolean implicitPfield) CucTimeEncoder
(int pfield1, int pfield2, boolean implicitPfield) -
Method Summary
-
Field Details
-
log
-
-
Constructor Details
-
CucTimeEncoder
public CucTimeEncoder(int pfield1, boolean implicitPfield) -
CucTimeEncoder
public CucTimeEncoder(int pfield1, int pfield2, boolean implicitPfield)
-
-
Method Details
-
encode
public int encode(long time, byte[] buf, int offset) Description copied from interface:TimeEncoder
Encodes the Yamcs instant into the binary buffer.It is assumed that the buffer will have enough space; if not, an
ArrayIndexOutOfBoundsException
will be thrown.- Specified by:
encode
in interfaceTimeEncoder
- Parameters:
time
- - time in milliseconds to be encodedbuf
- - where to write the encoded timeoffset
- - offset in the buffer where the encoding will begin- Returns:
- the number of bytes encoded
-
encodeRaw
public int encodeRaw(long time, byte[] buf, int offset) Description copied from interface:TimeEncoder
Encodes the time in an unspecified unit.This can be used when the on-board time is free running.
It is assumed that the buffer will have enough space; if not, an
ArrayIndexOutOfBoundsException
will be thrown.- Specified by:
encodeRaw
in interfaceTimeEncoder
- Parameters:
time
- - time in unspecified units to be encodedbuf
- - where to write the encoded timeoffset
- - offset in the buffer where the encoding will begin- Returns:
- the number of bytes encoded
-
toString
-
getEncodedLength
public int getEncodedLength()Description copied from interface:TimeEncoder
Returns the size in bytes of the encoded time.If the size is variable return -1
- Specified by:
getEncodedLength
in interfaceTimeEncoder
-