public final class UtcTimestampEncoder
extends java.lang.Object
UtcTimestampDecoder for details of the format.| 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 |
|---|
UtcTimestampEncoder() |
UtcTimestampEncoder(EpochFractionFormat epochFractionPrecision)
Create the encoder.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
buffer() |
int |
encode(long epochFraction)
Encode the current time into the buffer as an ascii UTC String
|
static int |
encode(long epochMillis,
MutableAsciiBuffer string,
int offset) |
int |
encodeFrom(long duration,
java.util.concurrent.TimeUnit timeUnit)
Encode the current time into the buffer as an ascii UTC String
|
static int |
encodeMicros(long epochMicros,
MutableAsciiBuffer string,
int offset) |
static int |
encodeNanos(long epochNanos,
MutableAsciiBuffer string,
int offset) |
int |
initialise(long epochFraction) |
int |
initialise(long duration,
java.util.concurrent.TimeUnit timeUnit) |
int |
update(long epochFraction)
Update the current time into the buffer as an ascii UTC String
|
int |
updateFrom(long duration,
java.util.concurrent.TimeUnit timeUnit)
Update the current time into the buffer as an ascii UTC String
|
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 UtcTimestampEncoder()
public UtcTimestampEncoder(EpochFractionFormat epochFractionPrecision)
epochFractionPrecision - true if you want to use milliseconds as the precision of the
timeunit for the epochFraction passed to encode().
False if you wish to use microseconds.public int encodeFrom(long duration,
java.util.concurrent.TimeUnit timeUnit)
duration - the current time as the number of specified time unit since the start of the UNIX Epoch.timeUnit - the TimeUnit of the duration.public int encode(long epochFraction)
epochFraction - the current time as the number of milliseconds, microseconds or nanoseconds since the
start of the UNIX Epoch. The unit of this parameter should align with the constructor
parameter EpochFractionFormat.public int initialise(long duration,
java.util.concurrent.TimeUnit timeUnit)
public int initialise(long epochFraction)
public int updateFrom(long duration,
java.util.concurrent.TimeUnit timeUnit)
duration - the current time as the number of specified time unit since the start of the UNIX Epoch.timeUnit - the TimeUnit of the duration.public int update(long epochFraction)
epochFraction - the current time as the number of milliseconds, microseconds or nanoseconds since the
start of the UNIX Epoch. The unit of this parameter should align with the constructor
parameter EpochFractionFormat.public byte[] buffer()
public static int encode(long epochMillis,
MutableAsciiBuffer string,
int offset)
public static int encodeMicros(long epochMicros,
MutableAsciiBuffer string,
int offset)
public static int encodeNanos(long epochNanos,
MutableAsciiBuffer string,
int offset)
Copyright © 2015-2022 Real Logic Limited. All Rights Reserved.