|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectcom.wowza.util.BufferUtils
public class BufferUtils
BufferUtils: utilities for converting between binary data and Java primitive types. Faster than Java runtime equivalents
| Constructor Summary | |
|---|---|
BufferUtils()
|
|
| Method Summary | |
|---|---|
static int |
byteArrayToInt(byte[] b)
Convert byte array to int |
static int |
byteArrayToInt(byte[] b,
int offset)
Conver byte array to int with offset |
static int |
byteArrayToInt(byte[] b,
int offset,
int count)
Convert byte array to int with offset. |
static int |
byteArrayToInt(byte[] b,
int offset,
int count,
boolean isReverse)
Convert byte array to int with offset. |
static long |
byteArrayToLong(byte[] b)
Convert byte array to long |
static long |
byteArrayToLong(byte[] b,
int offset)
Conver byte array to long with offset |
static long |
byteArrayToLong(byte[] b,
int offset,
int count)
Convert byte array to long with offset. |
static long |
byteArrayToLong(byte[] b,
int offset,
int count,
boolean isReverse)
Convert byte array to long with offset. |
static int |
byteArrayToShort(byte[] b)
Convert byte array to int |
static int |
byteArrayToShort(byte[] b,
int offset)
Conver byte array to int with offset |
static int |
byteArrayToShort(byte[] b,
int offset,
int count)
Convert byte array to int with offset. |
static int |
byteArrayToShort(byte[] b,
int offset,
int count,
boolean isReverse)
Convert byte array to int with offset. |
static String |
byteArrayToString(byte[] b)
Convert a byte array to a String (UTF-8 encoding assumed) |
static String |
byteArrayToString(byte[] b,
int offset,
int count)
Convert a byte array to a String (UTF-8 encoding assumed) |
static byte[] |
decodeHexString(String hexStr)
Decode a string as a byte array |
static int |
doCRC32(int crc,
byte[] buffer,
int offset,
int len)
Calculate an IEEE CRC32 value for MPEG transport stream from a starting crc value |
static String |
encodeHexString(byte[] bytes)
Encode a byte array as a string |
static String |
encodeHexString(byte[] bytes,
int offset,
int len)
Encode a byte array as a string |
static int |
getUnsignedShort(java.nio.ByteBuffer buffer)
|
static byte[] |
intToByteArray(int value)
Convert a int value to a byte array in network order |
static void |
intToByteArray(int value,
byte[] buffer,
int offset,
int size)
Convert a int value to a byte array in network order |
static void |
intToByteArray(int value,
byte[] buffer,
int offset,
int size,
boolean isReverse)
Convert a int value to a byte array in network order |
static byte[] |
intToByteArray(int value,
int size)
Convert a int value to a byte array in network order |
static byte[] |
longToByteArray(long value)
Convert a long value to a byte array in network order |
static void |
longToByteArray(long value,
byte[] buffer,
int offset,
int size)
Convert a long value to a byte array in network order |
static void |
longToByteArray(long value,
byte[] buffer,
int offset,
int size,
boolean isReverse)
Convert a long value to a byte array in network order |
static byte[] |
longToByteArray(long value,
int size)
Convert a long value to a byte array in network order |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferUtils()
| Method Detail |
|---|
public static int byteArrayToInt(byte[] b)
b - byte array (4 bytes)
public static int byteArrayToInt(byte[] b,
int offset)
b - byte array (4 bytes)offset - offset
public static int byteArrayToInt(byte[] b,
int offset,
int count)
b - byte arrayoffset - offsetcount - number of bytes
public static int byteArrayToInt(byte[] b,
int offset,
int count,
boolean isReverse)
b - byte arrayoffset - offsetcount - number of bytesisReverse - is data in reverse order
public static long byteArrayToLong(byte[] b)
b - byte array (8 bytes)
public static long byteArrayToLong(byte[] b,
int offset)
b - byte array (8 bytes)offset - offset
public static long byteArrayToLong(byte[] b,
int offset,
int count)
b - byte arrayoffset - offsetcount - number of bytes
public static long byteArrayToLong(byte[] b,
int offset,
int count,
boolean isReverse)
b - byte arrayoffset - offsetcount - number of bytesisReverse - is data in reverse order
public static int byteArrayToShort(byte[] b)
b - byte array (2 bytes)
public static int byteArrayToShort(byte[] b,
int offset)
b - byte array (2 bytes)offset - offset
public static int byteArrayToShort(byte[] b,
int offset,
int count)
b - byte arrayoffset - offsetcount - number of bytes
public static int byteArrayToShort(byte[] b,
int offset,
int count,
boolean isReverse)
b - byte arrayoffset - offsetcount - number of bytesisReverse - is data in reverse order
public static String byteArrayToString(byte[] b)
b - byte array
public static String byteArrayToString(byte[] b,
int offset,
int count)
b - byte arrayoffset - offsetcount - len
public static byte[] decodeHexString(String hexStr)
hexStr - string
public static int doCRC32(int crc,
byte[] buffer,
int offset,
int len)
crc - starting crc valuebuffer - bufferoffset - offsetlen - len
public static String encodeHexString(byte[] bytes)
bytes - byte array
public static String encodeHexString(byte[] bytes,
int offset,
int len)
bytes - byte arrayoffset - offsetlen - length
public static int getUnsignedShort(java.nio.ByteBuffer buffer)
public static byte[] intToByteArray(int value)
value - value
public static void intToByteArray(int value,
byte[] buffer,
int offset,
int size)
value - valuebuffer - destination byte arrayoffset - starting offset in byte arraysize - number of bytes to write
public static void intToByteArray(int value,
byte[] buffer,
int offset,
int size,
boolean isReverse)
value - valuebuffer - destination byte arrayoffset - starting offset in byte arraysize - number of bytes to writeisReverse - is data in reverse order
public static byte[] intToByteArray(int value,
int size)
value - valuesize - size of resultant byte array
public static byte[] longToByteArray(long value)
value - value
public static void longToByteArray(long value,
byte[] buffer,
int offset,
int size)
value - valuebuffer - destination byte arrayoffset - starting offset in byte arraysize - number of bytes to write
public static void longToByteArray(long value,
byte[] buffer,
int offset,
int size,
boolean isReverse)
value - valuebuffer - destination byte arrayoffset - starting offset in byte arraysize - number of bytes to writeisReverse - is data in reverse order
public static byte[] longToByteArray(long value,
int size)
value - valuesize - size of resultant byte array
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||