Top Description Constructors Methods
org.bouncycastle.util

public abstract Class Pack

extends Object
Class Inheritance

Utility methods for converting byte arrays into ints and longs, and back again.

Constructor Summary

AccessConstructor and Description
public
Pack()

Method Summary

Modifier and TypeMethod and Description
public static int
bigEndianToInt(byte[] bs, int off)

public static void
bigEndianToInt(byte[] bs, int off, int[] ns)

public static void
bigEndianToInt(byte[] bs, int off, int[] ns, int nsOff, int nsLen)

public static long
bigEndianToLong(byte[] bs, int off)

public static void
bigEndianToLong(byte[] bs, int off, long[] ns)

public static void
bigEndianToLong(byte[] bs, int bsOff, long[] ns, int nsOff, int nsLen)

public static long
bigEndianToLong(byte[] bs, int off, int len)

public static short
bigEndianToShort(byte[] bs, int off)

public static byte[]
public static void
intToBigEndian(int n, byte[] bs, int off)

public static byte[]
intToBigEndian(int[] ns)

public static void
intToBigEndian(int[] ns, byte[] bs, int off)

public static void
intToBigEndian(int[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)

public static byte[]
public static void
intToLittleEndian(int n, byte[] bs, int off)

public static byte[]
public static void
intToLittleEndian(int[] ns, byte[] bs, int off)

public static void
intToLittleEndian(int[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)

public static int
littleEndianToInt(byte[] bs, int off)

public static void
littleEndianToInt(byte[] bs, int off, int[] ns)

public static void
littleEndianToInt(byte[] bs, int bOff, int[] ns, int nOff, int count)

public static int[]
littleEndianToInt(byte[] bs, int off, int count)

public static int
littleEndianToInt_High(byte[] bs, int off, int len)

public static int
littleEndianToInt_Low(byte[] bs, int off, int len)

public static long
littleEndianToLong(byte[] bs, int off)

public static void
littleEndianToLong(byte[] bs, int off, long[] ns)

public static long
littleEndianToLong(byte[] input, int off, int len)

public static void
littleEndianToLong(byte[] bs, int bsOff, long[] ns, int nsOff, int nsLen)

public static long
littleEndianToLong_High(byte[] bs, int off, int len)

public static long
littleEndianToLong_Low(byte[] bs, int off, int len)

public static short
littleEndianToShort(byte[] bs, int off)

public static byte[]
public static void
longToBigEndian(long n, byte[] bs, int off)

public static byte[]
longToBigEndian(long[] ns)

public static void
longToBigEndian(long[] ns, byte[] bs, int off)

public static void
longToBigEndian(long[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)

public static void
longToBigEndian(long
The number
value
,
byte[]
The target.
bs
,
int
Position in target to start.
off
,
int
number of bytes to write.
bytes
)
Deprecated Will be removed

public static void
longToLittleEndian(long n, byte[] bs, int off, int len)

public static byte[]
public static void
longToLittleEndian(long n, byte[] bs, int off)

public static byte[]
longToLittleEndian(long[] ns)

public static void
longToLittleEndian(long[] ns, byte[] bs, int off)

public static void
longToLittleEndian(long[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)

public static void
longToLittleEndian_High(long n, byte[] bs, int off, int len)

public static byte[]
public static void
shortToBigEndian(short n, byte[] bs, int off)

public static byte[]
public static void
shortToLittleEndian(short n, byte[] bs, int off)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Packback to summary
public Pack()

Method Detail

bigEndianToIntback to summary
public static int bigEndianToInt(byte[] bs, int off)
bigEndianToIntback to summary
public static void bigEndianToInt(byte[] bs, int off, int[] ns)
bigEndianToIntback to summary
public static void bigEndianToInt(byte[] bs, int off, int[] ns, int nsOff, int nsLen)
bigEndianToLongback to summary
public static long bigEndianToLong(byte[] bs, int off)
bigEndianToLongback to summary
public static void bigEndianToLong(byte[] bs, int off, long[] ns)
bigEndianToLongback to summary
public static void bigEndianToLong(byte[] bs, int bsOff, long[] ns, int nsOff, int nsLen)
bigEndianToLongback to summary
public static long bigEndianToLong(byte[] bs, int off, int len)
bigEndianToShortback to summary
public static short bigEndianToShort(byte[] bs, int off)
intToBigEndianback to summary
public static byte[] intToBigEndian(int n)
intToBigEndianback to summary
public static void intToBigEndian(int n, byte[] bs, int off)
intToBigEndianback to summary
public static byte[] intToBigEndian(int[] ns)
intToBigEndianback to summary
public static void intToBigEndian(int[] ns, byte[] bs, int off)
intToBigEndianback to summary
public static void intToBigEndian(int[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)
intToLittleEndianback to summary
public static byte[] intToLittleEndian(int n)
intToLittleEndianback to summary
public static void intToLittleEndian(int n, byte[] bs, int off)
intToLittleEndianback to summary
public static byte[] intToLittleEndian(int[] ns)
intToLittleEndianback to summary
public static void intToLittleEndian(int[] ns, byte[] bs, int off)
intToLittleEndianback to summary
public static void intToLittleEndian(int[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)
littleEndianToIntback to summary
public static int littleEndianToInt(byte[] bs, int off)
littleEndianToIntback to summary
public static void littleEndianToInt(byte[] bs, int off, int[] ns)
littleEndianToIntback to summary
public static void littleEndianToInt(byte[] bs, int bOff, int[] ns, int nOff, int count)
littleEndianToIntback to summary
public static int[] littleEndianToInt(byte[] bs, int off, int count)
littleEndianToInt_Highback to summary
public static int littleEndianToInt_High(byte[] bs, int off, int len)
littleEndianToInt_Lowback to summary
public static int littleEndianToInt_Low(byte[] bs, int off, int len)
littleEndianToLongback to summary
public static long littleEndianToLong(byte[] bs, int off)
littleEndianToLongback to summary
public static void littleEndianToLong(byte[] bs, int off, long[] ns)
littleEndianToLongback to summary
public static long littleEndianToLong(byte[] input, int off, int len)
littleEndianToLongback to summary
public static void littleEndianToLong(byte[] bs, int bsOff, long[] ns, int nsOff, int nsLen)
littleEndianToLong_Highback to summary
public static long littleEndianToLong_High(byte[] bs, int off, int len)
littleEndianToLong_Lowback to summary
public static long littleEndianToLong_Low(byte[] bs, int off, int len)
littleEndianToShortback to summary
public static short littleEndianToShort(byte[] bs, int off)
longToBigEndianback to summary
public static byte[] longToBigEndian(long n)
longToBigEndianback to summary
public static void longToBigEndian(long n, byte[] bs, int off)
longToBigEndianback to summary
public static byte[] longToBigEndian(long[] ns)
longToBigEndianback to summary
public static void longToBigEndian(long[] ns, byte[] bs, int off)
longToBigEndianback to summary
public static void longToBigEndian(long[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)
longToBigEndianback to summary
public static void longToBigEndian(long value, byte[] bs, int off, int bytes)

Deprecated

Will be removed

Parameters
value:long

The number

bs:byte[]

The target.

off:int

Position in target to start.

bytes:int

number of bytes to write.

longToLittleEndianback to summary
public static void longToLittleEndian(long n, byte[] bs, int off, int len)
longToLittleEndianback to summary
public static byte[] longToLittleEndian(long n)
longToLittleEndianback to summary
public static void longToLittleEndian(long n, byte[] bs, int off)
longToLittleEndianback to summary
public static byte[] longToLittleEndian(long[] ns)
longToLittleEndianback to summary
public static void longToLittleEndian(long[] ns, byte[] bs, int off)
longToLittleEndianback to summary
public static void longToLittleEndian(long[] ns, int nsOff, int nsLen, byte[] bs, int bsOff)
longToLittleEndian_Highback to summary
public static void longToLittleEndian_High(long n, byte[] bs, int off, int len)
shortToBigEndianback to summary
public static byte[] shortToBigEndian(short n)
shortToBigEndianback to summary
public static void shortToBigEndian(short n, byte[] bs, int off)
shortToLittleEndianback to summary
public static byte[] shortToLittleEndian(short n)
shortToLittleEndianback to summary
public static void shortToLittleEndian(short n, byte[] bs, int off)