public class StaticProcs
extends java.lang.Object
Constructor and Description |
---|
StaticProcs() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
bitsOfByte(byte aByte)
Get the bits of a byte
|
static java.lang.String |
bitsOfBytes(byte[] bytes) |
static byte |
byteOfHex(byte[] hex)
Get the hex representation of a byte
|
static int |
bytesToUIntInt(byte[] bytes,
int index)
Combines two bytes (most significant bit first) into a 16 bit unsigned integer.
|
static long |
bytesToUIntLong(byte[] bytes,
int index)
Combines four bytes (most significant bit first) into a 32 bit unsigned integer.
|
static java.lang.String |
hexOfByte(byte aByte)
Get the hex representation of a byte
|
static void |
printBits(byte aByte)
Print the bits of a byte to standard out.
|
static byte[] |
uIntIntToByteWord(int i)
Converts an integer into an array of bytes.
|
static byte[] |
uIntLongToByteWord(long j)
Converts an unsigned 32 bit integer, stored in a long, into an array of bytes.
|
static long |
undoNtpMess(long ntpTs1,
long ntpTs2)
Recreates a UNIX timestamp based on the NTP representation used
in RTCP SR packets
|
public static byte[] uIntIntToByteWord(int i)
i
- a 16 bit unsigned integer in an intpublic static byte[] uIntLongToByteWord(long j)
j
- a longpublic static int bytesToUIntInt(byte[] bytes, int index)
index
- of most significant bytepublic static long bytesToUIntLong(byte[] bytes, int index)
bytes
- index
- of most significant bytepublic static long undoNtpMess(long ntpTs1, long ntpTs2)
ntpTs1
- from RTCP SR packetntpTs2
- from RTCP SR packetpublic static java.lang.String bitsOfByte(byte aByte)
aByte
- the byte you wish to convertpublic static java.lang.String hexOfByte(byte aByte)
aByte
- the byte you wish to convertpublic static byte byteOfHex(byte[] hex)
hex
- 4 bytes the byte you wish to convertpublic static void printBits(byte aByte)
aByte
- the byte you wish to print out.public static java.lang.String bitsOfBytes(byte[] bytes)