public final class UtcTimestampDecoder
extends java.lang.Object
Equivalent to a Java format string of "yyyyMMdd-HH:mm:ss[.SSS]". The builtin parsers could cope with this situation, but allocate and perform poorly.
If the final fraction of the second is expected to be in 3 characters and only supports up to millisecond precision
then you can use the normal decode(AsciiBuffer, int, int, boolean) method.
Support for microsecond precision, eg: "yyyyMMdd-HH:mm:ss[.SSSSSS]" is provided through the
decodeMicros(AsciiBuffer, int, int, boolean) method.
| Modifier and Type | Field and Description |
|---|---|
static int |
LENGTH_WITH_MICROSECONDS |
static int |
LENGTH_WITH_MILLISECONDS |
static int |
LENGTH_WITH_NANOSECONDS |
static int |
LENGTH_WITHOUT_MILLISECONDS |
static long |
MAX_EPOCH_MICROS |
static long |
MAX_EPOCH_MILLIS |
static long |
MAX_EPOCH_NANOS |
static long |
MIN_EPOCH_MICROS |
static long |
MIN_EPOCH_MILLIS |
static long |
MIN_EPOCH_NANOS |
| Constructor and Description |
|---|
UtcTimestampDecoder(boolean strict) |
| Modifier and Type | Method and Description |
|---|---|
static long |
decode(AsciiBuffer timestamp,
int offset,
int length,
boolean strict) |
long |
decode(byte[] bytes) |
long |
decode(byte[] bytes,
int length) |
static long |
decodeMicros(AsciiBuffer timestamp,
int offset,
int length,
boolean strict) |
long |
decodeMicros(byte[] bytes) |
long |
decodeMicros(byte[] bytes,
int length) |
static long |
decodeNanos(AsciiBuffer timestamp,
int offset,
int length,
boolean strict) |
long |
decodeNanos(byte[] bytes) |
long |
decodeNanos(byte[] bytes,
int length) |
public static final long MIN_EPOCH_MILLIS
public static final long MAX_EPOCH_MILLIS
public static final long MIN_EPOCH_MICROS
public static final long MAX_EPOCH_MICROS
public static final long MIN_EPOCH_NANOS
public static final long MAX_EPOCH_NANOS
public static final int LENGTH_WITHOUT_MILLISECONDS
public static final int LENGTH_WITH_MILLISECONDS
public static final int LENGTH_WITH_MICROSECONDS
public static final int LENGTH_WITH_NANOSECONDS
public UtcTimestampDecoder(boolean strict)
strict - if length of FIX encoded value has to be checked to match FIX specificationpublic long decode(byte[] bytes,
int length)
public long decode(byte[] bytes)
public long decodeMicros(byte[] bytes,
int length)
public long decodeMicros(byte[] bytes)
public long decodeNanos(byte[] bytes,
int length)
public long decodeNanos(byte[] bytes)
public static long decode(AsciiBuffer timestamp, int offset, int length, boolean strict)
timestamp - a buffer containing the FIX encoded value of the timestamp in ASCIIoffset - the offset within the timestamp buffer where the value startslength - the length of the FIX encoded value in bytes / ASCII charactersstrict - if length of FIX encoded value has to be checked to match FIX specificationjava.lang.NumberFormatException - if the value in the buffer isn't a valid timestamp.public static long decodeMicros(AsciiBuffer timestamp, int offset, int length, boolean strict)
timestamp - a buffer containing the FIX encoded value of the timestamp in ASCIIoffset - the offset within the timestamp buffer where the value startslength - the length of the FIX encoded value in bytes / ASCII charactersstrict - if length of FIX encoded value has to be checked to match FIX specificationjava.lang.NumberFormatException - if the value in the buffer isn't a valid timestamp.public static long decodeNanos(AsciiBuffer timestamp, int offset, int length, boolean strict)
timestamp - a buffer containing the FIX encoded value of the timestamp in ASCIIoffset - the offset within the timestamp buffer where the value startslength - the length of the FIX encoded value in bytes / ASCII charactersstrict - if length of FIX encoded value has to be checked to match FIX specificationjava.lang.NumberFormatException - if the value in the buffer isn't a valid timestamp.Copyright © 2015-2022 Real Logic Limited. All Rights Reserved.