@Deprecated
public class ByteUtilities
extends java.lang.Object
| Constructor and Description |
|---|
ByteUtilities(byte[] addressInBytes)
Deprecated.
Constructor initialized using a sequence of bytes.
|
ByteUtilities(int[] addressInInts)
Deprecated.
Constructor initialized using a sequence of integers.
|
| Modifier and Type | Method and Description |
|---|---|
int[] |
byteArrayToIntArray(byte[] byteArray)
Deprecated.
|
static int[] |
byteArrayToIntArray(byte[] byteArray,
int offset,
int numOfBytes)
Deprecated.
|
byte[] |
getAddressInBytes()
Deprecated.
This allows us to retrieve an integer sequence as a sequence of bytes.
|
int[] |
getAddressInInts()
Deprecated.
This allows us to retrieve an byte sequence as a sequence of integers.
|
static byte[] |
getBytes(int value)
Deprecated.
Returns the bytes that are associated with an integer value.
|
static byte[] |
getBytes(int[] intArray,
int pos)
Deprecated.
|
static byte[] |
getBytes(long value)
Deprecated.
Returns the bytes that are associated with a long value.
|
static byte[] |
getBytes(short value)
Deprecated.
Returns the bytes that are associated with a short value.
|
static int |
getFirstOneBitPosition(int value)
Deprecated.
Returns the position (1 through 32) of the first "1"-bit in the binary
representation of the supplied integer.
|
static int |
getFirstZeroBitPosition(int value)
Deprecated.
Returns the position (1 through 32) of the first "0"-bit in the binary
representation of the supplied integer.
|
static int |
getInt(byte[] data)
Deprecated.
Given a sequence of bytes, this method returns the int value associated
with the sequence of bytes.
|
static int |
getInt(byte[] data,
int offset)
Deprecated.
|
static int |
getIntFromByte(byte a)
Deprecated.
|
static int |
getLastOneBitPosition(int value)
Deprecated.
Returns the position (1 through 32) of the last "1"-bit in the binary
representation of the supplied integer.
|
static long |
getLong(byte[] data)
Deprecated.
Given a sequence of bytes, this method returns the long value associated
with the sequence of bytes.
|
static long |
getLong(byte[] data,
int offset)
Deprecated.
|
static short |
getShort(byte[] data)
Deprecated.
Given a sequence of bytes, this method returns the short value associated
with the sequence of bytes.
|
int |
getValue(byte a,
byte b)
Deprecated.
Give two bytes, it returns the Integer value of the 16-bit number
encoded within the 2 bytes a, b
|
byte[] |
intArrayToByteArray(int[] intArray)
Deprecated.
|
static byte[] |
intArrayToByteArray(int[] intArray,
int offset,
int len)
Deprecated.
|
static void |
main(java.lang.String[] args)
Deprecated.
|
static int |
performNotOperation(int value)
Deprecated.
This performs an inversion of the bits in an integer.
|
static java.lang.String |
printByte(byte b)
Deprecated.
This method is primarily used for debugging purposes, and provides
us with a representation of a byte as sequence of 1's and 0's that is
of length=8.
|
static java.lang.String |
printInt(int value)
Deprecated.
This method is primarily used for debugging purposes, and provides
us with a representation of an integer as sequence of 1's and 0's that
is of length=32.
|
public ByteUtilities(byte[] addressInBytes)
addressInBytes - The address as a sequence of bytes.public ByteUtilities(int[] addressInInts)
addressInInts - The address as a sequence of integers.public byte[] getAddressInBytes()
public int[] getAddressInInts()
public byte[] intArrayToByteArray(int[] intArray)
public static byte[] intArrayToByteArray(int[] intArray,
int offset,
int len)
public int[] byteArrayToIntArray(byte[] byteArray)
public static int[] byteArrayToIntArray(byte[] byteArray,
int offset,
int numOfBytes)
public int getValue(byte a,
byte b)
public static int getIntFromByte(byte a)
public static byte[] getBytes(short value)
value - The short for which we are seeking an equivalent
byte stream representation.public static byte[] getBytes(int value)
value - The integer for which we are seeking an equivalent
byte stream representation.public static byte[] getBytes(int[] intArray,
int pos)
public static byte[] getBytes(long value)
value - The long for which we are seeking an equivalent
byte stream representation.public static short getShort(byte[] data)
data - The sequence of bytes representing a short value.public static int getInt(byte[] data)
data - The sequence of bytes representing a int value.public static int getInt(byte[] data,
int offset)
public static long getLong(byte[] data)
data - The sequence of bytes representing a long value.public static long getLong(byte[] data,
int offset)
public static java.lang.String printByte(byte b)
public static java.lang.String printInt(int value)
public static int performNotOperation(int value)
public static int getFirstOneBitPosition(int value)
public static int getLastOneBitPosition(int value)
public static int getFirstZeroBitPosition(int value)
public static void main(java.lang.String[] args)