/** * Two ByteArray are equal when they have the same size and each byte * within the first <code>size</code> bytes are equal. */ @Override public boolean equals(Object o) { if(this == o) return true; if(!(o instanceof ByteArray)) return false; ByteArray other = (ByteArray)o; if(size != other.size) return false; return AoArrays.equals(array, other.array, 0, size); }
/** * The hashCode is created from the first <code>size</code> bytes. */ @Override public int hashCode() { return AoArrays.hashCode(array, 0, size); } }
/** * Finds the first index of an element or <code>-1</code> if not found. */ public static <E> int indexOf(E[] array, E element) { return indexOf(array, element, 0); }
if(sectorEnd>oldCapacity) { if(sector<oldCapacity || !com.aoindustries.util.AoArrays.allEquals(buff, 0, inBytes, (byte)0)) { if(inBytes<sectorSize) Arrays.fill(buff, sectorSize-inBytes, sectorSize, (byte)0); oldWriteCache.put(sector, buff); if(!com.aoindustries.util.AoArrays.equals(buff, oldBuff, 0, inBytes)) {
/** * Finds the last index of an element or <code>-1</code> if not found. */ public static int lastIndexOf(byte[] array, byte element) { return lastIndexOf(array, element, array.length-1); }
try { diff = AoArrays.compare( ((String)val).getBytes("UTF-8"), ((String)otherVal).getBytes("UTF-8")
/** * Finds the last index of an element or <code>-1</code> if not found. */ public static int lastIndexOf(long[] array, long element) { return lastIndexOf(array, element, array.length-1); }
if(!AoArrays.equals(inBuff, outBuff, 0, numBytes)) { if(DEBUG) System.err.println(pos+": Updating " + numBytes + " bytes of output"); out.seek(pos);
/** * Finds the first index of an element or <code>-1</code> if not found. */ public static int indexOf(char[] array, char element) { return indexOf(array, element, 0); }
/** * Finds the last index of an element or <code>-1</code> if not found. */ public static int lastIndexOf(short[] array, short element) { return lastIndexOf(array, element, array.length-1); }
raf.seek(position); raf.readFully(buff, 0, (int)count); if(!com.aoindustries.util.AoArrays.equals(buff, zeros, 0, (int)count)) { raf.seek(position); raf.write(zeros, 0, (int)count);
/** * Finds the first index of an element or <code>-1</code> if not found. */ public static <E extends Enum<E>> int indexOf(E[] array, E element) { return indexOf(array, element, 0); }
/** * Finds the last index of an element or <code>-1</code> if not found. */ public static <E extends Enum<E>> int lastIndexOf(E[] array, E element) { return lastIndexOf(array, element, array.length-1); }
/** * Finds the first index of an element or <code>-1</code> if not found. */ public static int indexOf(short[] array, short element) { return indexOf(array, element, 0); }
/** * Finds the last index of an element or <code>-1</code> if not found. */ public static int lastIndexOf(int[] array, int element) { return lastIndexOf(array, element, array.length-1); }
if(!AoArrays.equals(ioBuffer, MAGIC, 0, MAGIC.length)) throw new IllegalStateException("File does not appear to be a PersistentLinkedList (MAGIC mismatch)");
/** * Finds the first index of an element or <code>-1</code> if not found. */ public static int indexOf(float[] array, float element) { return indexOf(array, element, 0); }
/** * Finds the last index of an element or <code>-1</code> if not found. */ public static int lastIndexOf(double[] array, double element) { return lastIndexOf(array, element, array.length-1); }
/** * Finds the first index of an element or <code>-1</code> if not found. */ public static int indexOf(byte[] array, byte element) { return indexOf(array, element, 0); }