public final class LittleEndianConversions
extends java.lang.Object
BigEndianConversions
Modifier and Type | Method and Description |
---|---|
static byte[] |
I2OSP(int x)
Convert an integer to an octet string of length 4.
|
static void |
I2OSP(int value,
byte[] output,
int outOff)
Convert an integer into a byte array beginning at the specified offset.
|
static void |
I2OSP(int value,
byte[] output,
int outOff,
int outLen)
Convert an integer to a byte array beginning at the specified offset.
|
static byte[] |
I2OSP(long input)
Convert an integer to a byte array of length 8.
|
static void |
I2OSP(long input,
byte[] output,
int outOff)
Convert an integer to a byte array of length 8.
|
static int |
OS2IP(byte[] input)
Convert an octet string of length 4 to an integer.
|
static int |
OS2IP(byte[] input,
int inOff)
Convert an byte array of length 4 beginning at offset into an
integer.
|
static int |
OS2IP(byte[] input,
int inOff,
int inLen)
Convert a byte array of the given length beginning at offset
into an integer.
|
static long |
OS2LIP(byte[] input,
int inOff)
Convert a byte array of length 8 beginning at inOff into a
long integer.
|
static byte[] |
toByteArray(int[] input,
int outLen)
Convert an int array to a byte array of the specified length.
|
static int[] |
toIntArray(byte[] input)
Convert a byte array to an int array.
|
public static int OS2IP(byte[] input)
input
- the byte array holding the octet stringjava.lang.ArithmeticException
- if the length of the given octet string is larger than 4.public static int OS2IP(byte[] input, int inOff)
input
- the byte arrayinOff
- the offset into the byte arraypublic static int OS2IP(byte[] input, int inOff, int inLen)
input
- the byte arrayinOff
- the offset into the byte arrayinLen
- the length of the encodingpublic static long OS2LIP(byte[] input, int inOff)
input
- the byte arrayinOff
- the offset into the byte arraypublic static byte[] I2OSP(int x)
x
- the integer to convertpublic static void I2OSP(int value, byte[] output, int outOff)
value
- the integer to convertoutput
- the byte array to hold the resultoutOff
- the integer offset into the byte arraypublic static void I2OSP(int value, byte[] output, int outOff, int outLen)
value
- the integer to convertoutput
- the byte array to hold the resultoutOff
- the integer offset into the byte arrayoutLen
- the length of the encodingpublic static byte[] I2OSP(long input)
input
- the integer to convertpublic static void I2OSP(long input, byte[] output, int outOff)
input
- the integer to convertoutput
- byte array holding the outputoutOff
- offset in output array where the result is storedpublic static byte[] toByteArray(int[] input, int outLen)
input
- the int arrayoutLen
- the length of the converted arraypublic static int[] toIntArray(byte[] input)
input
- the byte array