Class LittleEndianBitConverter
- java.lang.Object
- 
- org.apache.tika.parser.microsoft.onenote.fsshttpb.util.LittleEndianBitConverter
 
- 
 public class LittleEndianBitConverter extends Object Implement a converter which converts to/from little-endian byte arrays
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 shorttoInt16(byte[] array, int index)Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array.static inttoInt32(byte[] array, int index)Returns a 32-bit signed integer converted from two bytes at a specified position in a byte array.static shortToUInt16(byte[] array, int index)Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array.static inttoUInt32(byte[] array, int index)Returns a 32-bit unsigned integer converted from two bytes at a specified position in a byte array.static longtoUInt64(byte[] array, int index)Returns a 64-bit unsigned integer converted from two bytes at a specified position in a byte array.
 
- 
- 
- 
Method Detail- 
ToUInt16public static short ToUInt16(byte[] array, int index) throws IOExceptionReturns 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
 
 - 
toUInt32public static int toUInt32(byte[] array, int index) throws IOExceptionReturns 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
 
 - 
toInt32public static int toInt32(byte[] array, int index) throws IOExceptionReturns 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
 
 - 
toInt16public static short toInt16(byte[] array, int index) throws IOExceptionReturns 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
 
 - 
toUInt64public static long toUInt64(byte[] array, int index) throws IOExceptionReturns 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
 
 - 
getBytespublic 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.
 
 - 
getBytespublic 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.
 
 
- 
 
-