Class LittleEndianBitConverter
java.lang.Object
org.apache.tika.parser.microsoft.onenote.fsshttpb.util.LittleEndianBitConverter
Implement a converter which converts to/from little-endian byte arrays
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getBytes
(int value) Returns the specified 32-bit unsigned integer value as an array of bytes.static byte[]
getBytes
(long value) Returns the specified 64-bit unsigned integer value as an array of bytes.static short
toInt16
(byte[] array, int index) Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.static int
toInt32
(byte[] array, int index) Returns a 32-bit signed integer converted from two bytes at a specified position in a byte array.static short
ToUInt16
(byte[] array, int index) Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.static int
toUInt32
(byte[] array, int index) Returns a 32-bit unsigned integer converted from two bytes at a specified position in a byte array.static long
toUInt64
(byte[] array, int index) Returns a 64-bit unsigned integer converted from two bytes at a specified position in a byte array.
-
Method Details
-
ToUInt16
Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.- Parameters:
array
- Specify an array of bytes.index
- Specify the starting position.- Returns:
- Returns a 16-bit unsigned integer formed by two bytes beginning at startIndex.
- Throws:
IOException
-
toUInt32
Returns a 32-bit unsigned integer converted from two bytes at a specified position in a byte array.- Parameters:
array
- Specify an array of bytes.index
- Specify the starting position.- Returns:
- Returns a 32-bit unsigned integer formed by two bytes beginning at startIndex.
- Throws:
IOException
-
toInt32
Returns a 32-bit signed integer converted from two bytes at a specified position in a byte array.- Parameters:
array
- Specify an array of bytes.index
- Specify the starting position.- Returns:
- Returns a 32-bit signed integer formed by two bytes beginning at startIndex.
- Throws:
IOException
-
toInt16
Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.- Parameters:
array
- Specify an array of bytes.index
- Specify the starting position.- Returns:
- Returns a 16-bit signed integer formed by two bytes beginning at startIndex.
- Throws:
IOException
-
toUInt64
Returns a 64-bit unsigned integer converted from two bytes at a specified position in a byte array.- Parameters:
array
- Specify an array of bytes.index
- Specify the starting position.- Returns:
- Returns a 64-bit unsigned integer formed by two bytes beginning at startIndex.
- Throws:
IOException
-
getBytes
public static byte[] getBytes(long value) Returns the specified 64-bit unsigned integer value as an array of bytes.- Parameters:
value
- Specify the number to convert.- Returns:
- Returns an array of bytes with length 8.
-
getBytes
public static byte[] getBytes(int value) Returns the specified 32-bit unsigned integer value as an array of bytes.- Parameters:
value
- Specify the number to convert.- Returns:
- Returns an array of bytes with length 4.
-