Class HighResolutionTimestamp

    • Constructor Detail

      • HighResolutionTimestamp

        public HighResolutionTimestamp()
    • Method Detail

      • getLocalDateTime

        public LocalDateTime getLocalDateTime()
        Returns timestamp without high resolution component of the high resolution timestamp.
        Returns:
        timestamp without high resolution component of the high resolution timestamp
      • setLocalDateTime

        public void setLocalDateTime​(LocalDateTime localDateTime)
        Sets timestamp without high resolution component of the high resolution timestamp.
        Parameters:
        localDateTime - timestamp without high resolution component to be set
      • getPicoSecond

        public long getPicoSecond()
        Returns picosecond component of the high resolution timestamp.
        Returns:
        picosecond component of the high resolution timestamp
      • setPicoSecond

        public void setPicoSecond​(long picoSecond)
        Sets picosecond component of the high resolution timestamp.
        Parameters:
        picoSecond - picoseconds to be set
      • parse

        public void parse​(byte[] buffer,
                          int offset,
                          int length,
                          TimestampFormat format)
                   throws ParseException
        Parses timestamp from byte array.
        Parameters:
        buffer - source buffer
        offset - offset in the source buffer
        length - length of the value in the source buffer
        format - timestamp format to be parsed
        Throws:
        NullPointerException - if (null == buffer) or (null == format)
        IllegalArgumentException - if (offset < 0) or (offset + length > buffer.length)
        ParseException - if byte array can not be parsed with specified format
      • tryParse

        public boolean tryParse​(byte[] buffer,
                                int offset,
                                int length,
                                TimestampFormat format)
        Tries to parse timestamp from byte array.
        Parameters:
        buffer - source buffer
        offset - offset in the source buffer
        length - length of the value in the source buffer
        format - timestamp format to be parsed
        Returns:
        true if timestamp successfully parsed, false otherwise.
        Throws:
        NullPointerException - if (null == buffer) or (null == format)
        IllegalArgumentException - if (offset < 0) or (offset + length > buffer.length)
      • assemble

        public void assemble​(byte[] buffer,
                             int offset,
                             TimestampFormat format)
        Assemble high resolution timestamp into specified buffer from specified offset with corresponding format.
        Parameters:
        buffer - buffer to be used for assemble
        offset - offset in the buffer to be used
        format - format to be used for assemble
        Throws:
        NullPointerException - if (null == buffer) or (null == format)
        IllegalArgumentException - if (offset + [format length] > buffer.length)