This class implements as set of utility functions.
More...
|
| static void | store_int2 (int val, byte[] buf, int pos) |
| | <> More...
|
| |
| static void | store_int3 (int val, byte[] buf, int pos) |
| | <> More...
|
| |
| static void | store_int4 (int val, byte[] buf, int pos) |
| | <> More...
|
| |
| static int | load_int2 (byte[] buf, int pos) |
| | <> More...
|
| |
| static int | load_int3 (byte[] buf, int pos) |
| | <> More...
|
| |
| static int | load_int4 (byte[] buf, int pos) |
| | <> More...
|
| |
| static byte[] | concat (byte[] a, byte[] b) |
| | <> More...
|
| |
| static byte[] | copyOf (byte[] a, int ofs, int len) |
| | <> More...
|
| |
| static byte[] | lstrip (byte[] a, int c) |
| | <> More...
|
| |
| static void | xtrace (PrintStream out, String str, byte[] data) |
| | <> More...
|
| |
| static void | xtrace (PrintStream out, byte[] data) |
| | <> More...
|
| |
| static void | xtrace (String str, byte[] data) |
| | <> More...
|
| |
| static void | xtrace (byte[] data) |
| | <> More...
|
| |
This class implements as set of utility functions.
Some of the static methods may be useful for applications that work with the CryptoServer.
◆ store_int2()
| static void store_int2 |
( |
int |
val, |
|
|
byte[] |
buf, |
|
|
int |
pos |
|
) |
| |
|
static |
<>
Stores a 2-byte integer in to byte stream. The integer is stored in big endian order.
- Parameters
-
| val | Integer value to be stored (unsigned). |
| buf | Byte array into which the integer is stored. |
| pos | Position in the array (index), where the interger is stored. |
◆ store_int3()
| static void store_int3 |
( |
int |
val, |
|
|
byte[] |
buf, |
|
|
int |
pos |
|
) |
| |
|
static |
<>
Stores a 3-byte integer in to byte stream. The integer is stored in big endian order.
- Parameters
-
| val | Integer value to be stored (unsigned). |
| buf | Byte array into which the integer is stored. |
| pos | Position in the array (index), where the interger is stored. |
◆ store_int4()
| static void store_int4 |
( |
int |
val, |
|
|
byte[] |
buf, |
|
|
int |
pos |
|
) |
| |
|
static |
<>
Stores a 4-byte integer in to byte stream. The integer is stored in big endian order.
- Parameters
-
| val | Integer value to be stored (unsigned). |
| buf | Byte array into which the integer is stored. |
| pos | Position in the array (index), where the interger is stored. |
◆ load_int2()
| static int load_int2 |
( |
byte[] |
buf, |
|
|
int |
pos |
|
) |
| |
|
static |
<>
Loads a 2-byte integer from a byte stream. The integer must be stored in big endian order.
- Parameters
-
| buf | Byte array from which the integer is loaded. |
| pos | Position in the array (index), where the interger is loaded. |
- Returns
- Integer value loaded (unsigned).
◆ load_int3()
| static int load_int3 |
( |
byte[] |
buf, |
|
|
int |
pos |
|
) |
| |
|
static |
<>
Loads a 3-byte integer from a byte stream. The integer must be stored in big endian order.
- Parameters
-
| buf | Byte array from which the integer is loaded. |
| pos | Position in the array (index), where the interger is loaded. |
- Returns
- Integer value loaded (unsigned).
◆ load_int4()
| static int load_int4 |
( |
byte[] |
buf, |
|
|
int |
pos |
|
) |
| |
|
static |
<>
Loads a 4-byte integer from a byte stream. The integer must be stored in big endian order.
- Parameters
-
| buf | Byte array from which the integer is loaded. |
| pos | Position in the array (index), where the interger is loaded. |
- Returns
- Integer value loaded.
◆ concat()
| static byte[] concat |
( |
byte[] |
a, |
|
|
byte[] |
b |
|
) |
| |
|
static |
<>
Concatenates two byte arrays
- Parameters
-
| a | first byte array |
| b | second byte array |
- Returns
- concatenated arrays (a | b)
◆ copyOf()
| static byte[] copyOf |
( |
byte[] |
a, |
|
|
int |
ofs, |
|
|
int |
len |
|
) |
| |
|
static |
<>
Returns part of a byte array
- Parameters
-
| a | original byte array |
| ofs | offset to copied area |
| len | number of bytes to be copied |
- Returns
- byte array containing the copied area
◆ lstrip()
| static byte[] lstrip |
( |
byte[] |
a, |
|
|
int |
c |
|
) |
| |
|
static |
<>
Strips leading characters from the given byte array
- Parameters
-
| a | byte array to be stripped |
| c | character to be stripped |
- Returns
- stripped byte array
◆ xtrace() [1/4]
| static void xtrace |
( |
PrintStream |
out, |
|
|
String |
str, |
|
|
byte[] |
data |
|
) |
| |
|
static |
<>
Prints the contents of a byte array. The byte array is printed hexadecimal and ASCII to a given PrintStream.
- Parameters
-
| out | PrintStream to which the output is send. |
| str | Headline for the output. |
| data | Byte array to be printed. |
◆ xtrace() [2/4]
| static void xtrace |
( |
PrintStream |
out, |
|
|
byte[] |
data |
|
) |
| |
|
static |
<>
Prints the contents of a byte array. The byte array is printed hexadecimal and ASCII to a given PrintStream.
- Parameters
-
| out | PrintStream to which the output is send. |
| data | Byte array to be printed. |
◆ xtrace() [3/4]
| static void xtrace |
( |
String |
str, |
|
|
byte[] |
data |
|
) |
| |
|
static |
<>
Prints the contents of a byte array. The byte array is printed hexadecimal and ASCII to System.out.
- Parameters
-
| str | Headline for the output. |
| data | Byte array to be printed. |
◆ xtrace() [4/4]
| static void xtrace |
( |
byte[] |
data | ) |
|
|
static |
<>
Prints the contents of a byte array. The byte array is printed hexadecimal and ASCII to System.out.
- Parameters
-
| data | Byte array to be printed. |