Package io.anyline.nfc.bouncycastle.util
Class Pack
-
- All Implemented Interfaces:
public abstract class Pack
Utility methods for converting byte arrays into ints and longs, and back again.
-
-
Constructor Summary
Constructors Constructor Description Pack()
-
Method Summary
Modifier and Type Method Description static short
bigEndianToShort(Array<byte> bs, int off)
static int
bigEndianToInt(Array<byte> bs, int off)
static void
bigEndianToInt(Array<byte> bs, int off, Array<int> ns)
static void
bigEndianToInt(Array<byte> bs, int off, Array<int> ns, int nsOff, int nsLen)
static Array<byte>
intToBigEndian(int n)
static void
intToBigEndian(int n, Array<byte> bs, int off)
static Array<byte>
intToBigEndian(Array<int> ns)
static void
intToBigEndian(Array<int> ns, Array<byte> bs, int off)
static void
intToBigEndian(Array<int> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
static long
bigEndianToLong(Array<byte> bs, int off)
static void
bigEndianToLong(Array<byte> bs, int off, Array<long> ns)
static void
bigEndianToLong(Array<byte> bs, int bsOff, Array<long> ns, int nsOff, int nsLen)
static Array<byte>
longToBigEndian(long n)
static void
longToBigEndian(long n, Array<byte> bs, int off)
static Array<byte>
longToBigEndian(Array<long> ns)
static void
longToBigEndian(Array<long> ns, Array<byte> bs, int off)
static void
longToBigEndian(Array<long> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
static void
longToBigEndian(long value, Array<byte> bs, int off, int bytes)
static short
littleEndianToShort(Array<byte> bs, int off)
static int
littleEndianToInt(Array<byte> bs, int off)
static void
littleEndianToInt(Array<byte> bs, int off, Array<int> ns)
static void
littleEndianToInt(Array<byte> bs, int bOff, Array<int> ns, int nOff, int count)
static Array<int>
littleEndianToInt(Array<byte> bs, int off, int count)
static Array<byte>
shortToLittleEndian(short n)
static void
shortToLittleEndian(short n, Array<byte> bs, int off)
static Array<byte>
shortToBigEndian(short n)
static void
shortToBigEndian(short n, Array<byte> bs, int off)
static Array<byte>
intToLittleEndian(int n)
static void
intToLittleEndian(int n, Array<byte> bs, int off)
static Array<byte>
intToLittleEndian(Array<int> ns)
static void
intToLittleEndian(Array<int> ns, Array<byte> bs, int off)
static void
intToLittleEndian(Array<int> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
static long
littleEndianToLong(Array<byte> bs, int off)
static void
littleEndianToLong(Array<byte> bs, int off, Array<long> ns)
static void
littleEndianToLong(Array<byte> bs, int bsOff, Array<long> ns, int nsOff, int nsLen)
static Array<byte>
longToLittleEndian(long n)
static void
longToLittleEndian(long n, Array<byte> bs, int off)
static Array<byte>
longToLittleEndian(Array<long> ns)
static void
longToLittleEndian(Array<long> ns, Array<byte> bs, int off)
static void
longToLittleEndian(Array<long> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
-
-
Method Detail
-
bigEndianToShort
static short bigEndianToShort(Array<byte> bs, int off)
-
bigEndianToInt
static int bigEndianToInt(Array<byte> bs, int off)
-
bigEndianToInt
static void bigEndianToInt(Array<byte> bs, int off, Array<int> ns)
-
bigEndianToInt
static void bigEndianToInt(Array<byte> bs, int off, Array<int> ns, int nsOff, int nsLen)
-
intToBigEndian
static Array<byte> intToBigEndian(int n)
-
intToBigEndian
static void intToBigEndian(int n, Array<byte> bs, int off)
-
intToBigEndian
static Array<byte> intToBigEndian(Array<int> ns)
-
intToBigEndian
static void intToBigEndian(Array<int> ns, Array<byte> bs, int off)
-
intToBigEndian
static void intToBigEndian(Array<int> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
-
bigEndianToLong
static long bigEndianToLong(Array<byte> bs, int off)
-
bigEndianToLong
static void bigEndianToLong(Array<byte> bs, int off, Array<long> ns)
-
bigEndianToLong
static void bigEndianToLong(Array<byte> bs, int bsOff, Array<long> ns, int nsOff, int nsLen)
-
longToBigEndian
static Array<byte> longToBigEndian(long n)
-
longToBigEndian
static void longToBigEndian(long n, Array<byte> bs, int off)
-
longToBigEndian
static Array<byte> longToBigEndian(Array<long> ns)
-
longToBigEndian
static void longToBigEndian(Array<long> ns, Array<byte> bs, int off)
-
longToBigEndian
static void longToBigEndian(Array<long> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
-
longToBigEndian
static void longToBigEndian(long value, Array<byte> bs, int off, int bytes)
- Parameters:
value
- The numberbs
- The target.off
- Position in target to start.bytes
- number of bytes to write.
-
littleEndianToShort
static short littleEndianToShort(Array<byte> bs, int off)
-
littleEndianToInt
static int littleEndianToInt(Array<byte> bs, int off)
-
littleEndianToInt
static void littleEndianToInt(Array<byte> bs, int off, Array<int> ns)
-
littleEndianToInt
static void littleEndianToInt(Array<byte> bs, int bOff, Array<int> ns, int nOff, int count)
-
littleEndianToInt
static Array<int> littleEndianToInt(Array<byte> bs, int off, int count)
-
shortToLittleEndian
static Array<byte> shortToLittleEndian(short n)
-
shortToLittleEndian
static void shortToLittleEndian(short n, Array<byte> bs, int off)
-
shortToBigEndian
static Array<byte> shortToBigEndian(short n)
-
shortToBigEndian
static void shortToBigEndian(short n, Array<byte> bs, int off)
-
intToLittleEndian
static Array<byte> intToLittleEndian(int n)
-
intToLittleEndian
static void intToLittleEndian(int n, Array<byte> bs, int off)
-
intToLittleEndian
static Array<byte> intToLittleEndian(Array<int> ns)
-
intToLittleEndian
static void intToLittleEndian(Array<int> ns, Array<byte> bs, int off)
-
intToLittleEndian
static void intToLittleEndian(Array<int> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
-
littleEndianToLong
static long littleEndianToLong(Array<byte> bs, int off)
-
littleEndianToLong
static void littleEndianToLong(Array<byte> bs, int off, Array<long> ns)
-
littleEndianToLong
static void littleEndianToLong(Array<byte> bs, int bsOff, Array<long> ns, int nsOff, int nsLen)
-
longToLittleEndian
static Array<byte> longToLittleEndian(long n)
-
longToLittleEndian
static void longToLittleEndian(long n, Array<byte> bs, int off)
-
longToLittleEndian
static Array<byte> longToLittleEndian(Array<long> ns)
-
longToLittleEndian
static void longToLittleEndian(Array<long> ns, Array<byte> bs, int off)
-
longToLittleEndian
static void longToLittleEndian(Array<long> ns, int nsOff, int nsLen, Array<byte> bs, int bsOff)
-
-
-
-