Package deltix.qsrv.hf.pub.codec
Class TimeCodec
- java.lang.Object
-
- deltix.qsrv.hf.pub.codec.TimeCodec
-
public class TimeCodec extends java.lang.Object
Time is binary-encoded in the following ways, depending on scale Scale # Bytes Head Bits # Bits in Value Range, Years s*10-6 7 000 53 569 s*10-3 6 001 45 2225 s 5 010 37 8692 s*10 4 011 29 339 h 3 100 21 477
-
-
Field Summary
Fields Modifier and Type Field Description static long
BASE
static int
MAX_SIZE
static int
TIME_SCALE_10_SECONDS
static int
TIME_SCALE_HOURS
static int
TIME_SCALE_INVALID
static int
TIME_SCALE_LONG_NANOS
static int
TIME_SCALE_MILLISECONDS
static int
TIME_SCALE_MILLISECONDS_FIELD_SIZE
static int
TIME_SCALE_NANOS
static int
TIME_SCALE_SECONDS
static int
TIME_SCALE_SPECIAL
-
Constructor Summary
Constructors Constructor Description TimeCodec()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getFieldSize(long nanoSeconds)
static int
getFieldSize(long milliseconds, int nanosComponent)
static long
readNanoTime(deltix.util.memory.MemoryDataInput in)
static long
readTime(deltix.util.memory.MemoryDataInput in)
static void
readTime(deltix.util.memory.MemoryDataInput in, deltix.qsrv.hf.pub.TimeStamp time)
static void
skipTime(deltix.util.memory.MemoryDataInput in)
static void
writeNanoTime(long nanos, deltix.util.memory.MemoryDataOutput out)
static void
writeNanoTimeNoScale(long nanos, deltix.util.memory.MemoryDataOutput out)
Writes timestamp without value compression.static void
writeTime(long t, deltix.util.memory.MemoryDataOutput out)
Write time in millisecondsstatic void
writeTime(deltix.qsrv.hf.pub.InstrumentMessageInfo msg, deltix.util.memory.MemoryDataOutput out)
-
-
-
Field Detail
-
MAX_SIZE
public static final int MAX_SIZE
- See Also:
- Constant Field Values
-
BASE
public static final long BASE
- See Also:
- Constant Field Values
-
TIME_SCALE_INVALID
public static final int TIME_SCALE_INVALID
- See Also:
- Constant Field Values
-
TIME_SCALE_MILLISECONDS
public static final int TIME_SCALE_MILLISECONDS
- See Also:
- Constant Field Values
-
TIME_SCALE_SECONDS
public static final int TIME_SCALE_SECONDS
- See Also:
- Constant Field Values
-
TIME_SCALE_10_SECONDS
public static final int TIME_SCALE_10_SECONDS
- See Also:
- Constant Field Values
-
TIME_SCALE_HOURS
public static final int TIME_SCALE_HOURS
- See Also:
- Constant Field Values
-
TIME_SCALE_SPECIAL
public static final int TIME_SCALE_SPECIAL
- See Also:
- Constant Field Values
-
TIME_SCALE_NANOS
public static final int TIME_SCALE_NANOS
- See Also:
- Constant Field Values
-
TIME_SCALE_LONG_NANOS
public static final int TIME_SCALE_LONG_NANOS
- See Also:
- Constant Field Values
-
TIME_SCALE_MILLISECONDS_FIELD_SIZE
public static final int TIME_SCALE_MILLISECONDS_FIELD_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
readTime
public static long readTime(deltix.util.memory.MemoryDataInput in)
-
readTime
public static void readTime(deltix.util.memory.MemoryDataInput in, deltix.qsrv.hf.pub.TimeStamp time)
-
readNanoTime
public static long readNanoTime(deltix.util.memory.MemoryDataInput in)
-
skipTime
public static void skipTime(deltix.util.memory.MemoryDataInput in)
-
getFieldSize
public static int getFieldSize(long nanoSeconds)
-
getFieldSize
public static int getFieldSize(long milliseconds, int nanosComponent)
-
writeNanoTime
public static void writeNanoTime(long nanos, deltix.util.memory.MemoryDataOutput out)
-
writeNanoTimeNoScale
public static void writeNanoTimeNoScale(long nanos, deltix.util.memory.MemoryDataOutput out)
Writes timestamp without value compression. Similar towriteNanoTime(long, deltix.util.memory.MemoryDataOutput)
but will always use TIME_SCALE_LONG_NANOS scale so field size is always hasMAX_SIZE
size.
-
writeTime
public static void writeTime(deltix.qsrv.hf.pub.InstrumentMessageInfo msg, deltix.util.memory.MemoryDataOutput out)
-
writeTime
public static void writeTime(long t, deltix.util.memory.MemoryDataOutput out)
Write time in milliseconds- Parameters:
t
- millisecondsout
- output
-
-