public class ArrayUtil
extends java.lang.Object
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.6 $
Modifier and Type | Method and Description |
---|---|
static boolean |
areEqual(byte[] a,
byte[] b)
Compares two byte arrays for equality.
|
static boolean |
areEqual(int[] a,
int[] b)
Compares two int arrays for equality.
|
static void |
clear(byte[] buf)
Clears a byte array to all-zeroes.
|
static void |
clear(byte[] buf,
int offset,
int length)
Clears length bytes of a byte array to zeroes, starting at
offset.
|
static int |
compared(byte[] a,
byte[] b,
boolean msbFirst) |
static boolean |
isText(byte[] buffer) |
static byte[] |
toBytes(int n)
Returns a 4-byte array built from an int.
|
static byte[] |
toBytes(short[] array) |
static byte[] |
toBytes(short[] array,
int offset,
int length)
Returns a byte array built from a short array.
|
static int |
toInt(short s0,
short s1)
Returns an int built from two shorts.
|
static short |
toShort(byte b0,
byte b1)
Returns a short built from two bytes.
|
static short[] |
toShorts(byte[] array) |
static short[] |
toShorts(byte[] array,
int offset,
int length)
Returns a short array built from a byte array.
|
public static void clear(byte[] buf)
public static void clear(byte[] buf, int offset, int length)
public static int toInt(short s0, short s1)
s0
- the least significant shorts1
- the most significant shortpublic static short toShort(byte b0, byte b1)
b0
- the least significant byteb1
- the most significant bytepublic static byte[] toBytes(int n)
public static byte[] toBytes(short[] array, int offset, int length)
If offset and length are omitted, the whole array is used.
public static byte[] toBytes(short[] array)
public static short[] toShorts(byte[] array, int offset, int length)
If offset and length are omitted, the whole array is used.
public static short[] toShorts(byte[] array)
public static boolean areEqual(byte[] a, byte[] b)
public static boolean areEqual(int[] a, int[] b)
public static int compared(byte[] a, byte[] b, boolean msbFirst)
public static boolean isText(byte[] buffer)