public class NtpTimeStamp
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.text.SimpleDateFormat |
DATE_FORMAT |
private long |
fraction |
private static long |
NTP_EPOCH_DIFFERENCE
The number of milliseconds difference between the Java epoch and
the NTP epoch ( January 1, 1900, 00:00:00 GMT ).
|
private long |
seconds |
private static java.util.TimeZone |
UTC_TIME_ZONE |
| Constructor and Description |
|---|
NtpTimeStamp()
Creates a new instance of NtpTimeStamp that represents the time "right now."
|
NtpTimeStamp(java.nio.ByteBuffer data)
Creates a new instance of NtpTimeStamp from encoded data in a
ByteBuffer. |
NtpTimeStamp(java.util.Date date)
Creates a new instance of NtpTimeStamp that represents the given
Date. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
private int |
makePositive(byte b) |
java.lang.String |
toString() |
void |
writeTo(java.nio.ByteBuffer buffer)
Writes this
NtpTimeStamp to the given ByteBuffer. |
private static final long NTP_EPOCH_DIFFERENCE
private static final java.text.SimpleDateFormat DATE_FORMAT
private static final java.util.TimeZone UTC_TIME_ZONE
private long seconds
private long fraction
public NtpTimeStamp()
public NtpTimeStamp(java.util.Date date)
Date.date - public NtpTimeStamp(java.nio.ByteBuffer data)
ByteBuffer.data - public void writeTo(java.nio.ByteBuffer buffer)
NtpTimeStamp to the given ByteBuffer.buffer - public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprivate int makePositive(byte b)