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

      • TimeCodec

        public TimeCodec()
    • 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 to writeNanoTime(long, deltix.util.memory.MemoryDataOutput) but will always use TIME_SCALE_LONG_NANOS scale so field size is always has MAX_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 - milliseconds
        out - output