public final class BigEndianConversions
extends java.lang.Object
LittleEndianConversions
Modifier and Type | Method and Description |
---|---|
static byte[] |
I2OSP(int x)
Convert an integer to an octet string of length 4 according to IEEE 1363,
Section 5.5.3.
|
static void |
I2OSP(int input,
byte[] output,
int outOff)
Convert an integer to an octet string of length 4 according to IEEE 1363,
Section 5.5.3.
|
static void |
I2OSP(int input,
byte[] output,
int outOff,
int length)
Convert an integer to an octet string of the specified length according
to IEEE 1363, Section 5.5.3.
|
static byte[] |
I2OSP(int x,
int oLen)
Convert an integer to an octet string according to IEEE 1363, Section
5.5.3.
|
static byte[] |
I2OSP(long input)
Convert an integer to an octet string of length 8 according to IEEE 1363,
Section 5.5.3.
|
static void |
I2OSP(long input,
byte[] output,
int outOff)
Convert an integer to an octet string of length 8 according to IEEE 1363,
Section 5.5.3.
|
static int |
OS2IP(byte[] input)
Convert an octet string to an integer according to IEEE 1363, Section
5.5.3.
|
static int |
OS2IP(byte[] input,
int inOff)
Convert a byte array of length 4 beginning at offset into an
integer.
|
static int |
OS2IP(byte[] input,
int inOff,
int inLen)
Convert an octet string to an integer according to IEEE 1363, Section
5.5.3.
|
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)
Convert an int array into a byte array.
|
static byte[] |
toByteArray(int[] input,
int length)
Convert an int array into a byte array of the specified length.
|
static int[] |
toIntArray(byte[] input)
Convert a byte array into an int array.
|
public static byte[] I2OSP(int x)
x
- the integer to convertpublic static byte[] I2OSP(int x, int oLen) throws java.lang.ArithmeticException
x
- the integer to convertoLen
- the desired length of the octet stringjava.lang.ArithmeticException
- if x can't be encoded into oLen
octets.public static void I2OSP(int 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[] 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 void I2OSP(int input, byte[] output, int outOff, int length)
input
- the integer to convertoutput
- byte array holding the outputoutOff
- offset in output array where the result is storedlength
- the length of the encodingpublic 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 array holding the octet stringinOff
- the offset in the input byte array where the octet string
startsinLen
- the length of the encoded integerpublic static long OS2LIP(byte[] input, int inOff)
input
- the byte arrayinOff
- the offset into the byte arraypublic static byte[] toByteArray(int[] input)
input
- the int arraypublic static byte[] toByteArray(int[] input, int length)
input
- the int arraylength
- the length of the converted arraypublic static int[] toIntArray(byte[] input)
input
- the byte array