com.eyebolt.util
Class ArrayUtils

java.lang.Object
  |
  +--com.eyebolt.util.ArrayUtils

public class ArrayUtils
extends java.lang.Object

Array utility methods

Version:
$Revision: 1.1 $
Author:
John Gardner

Constructor Summary
ArrayUtils()
           
 
Method Summary
static boolean equals(byte[] a1, byte[] a2)
          Returns true if the two specified arrays of bytes are equal to one another.
static boolean sliceEquals(byte[] a1, int a1Offset, byte[] a2, int a2Offset, int length)
          Returns true if the two specified ranges of bytes are equal to one another.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

ArrayUtils

public ArrayUtils()
Method Detail

equals

public static boolean equals(byte[] a1,
                             byte[] a2)
Returns true if the two specified arrays of bytes are equal to one another. Two arrays are considered equal if both arrays contain the same number of elements, and all corresponding pairs of elements in the two arrays are equal. In other words, two arrays are equal if they contain the same elements in the same order. Also, two array references are considered equal if both are null.

Parameters:
a1 - one array to be tested for equality.
a2 - the other array to be tested for equality.
Returns:
true if the two arrays are equal.

sliceEquals

public static boolean sliceEquals(byte[] a1,
                                  int a1Offset,
                                  byte[] a2,
                                  int a2Offset,
                                  int length)
Returns true if the two specified ranges of bytes are equal to one another. Two ranges are considered equal if both ranges contain the same number of elements, and all corresponding pairs of elements in the two ranges are equal. In other words, two ranges are equal if they contain the same elements in the same order. Also, two array references are considered equal if both are null.

Parameters:
a1 - one array to be tested for equality.
a1Offset - offset into a1 to begin comparing
a2 - the other array to be tested for equality.
a2Offset - offset into a2 to begin comparing
length - how far to compare
Returns:
true if the two ranges are equal.


Copyright © 2001 Eyebolt, Inc.