/** * Get a byte iterator for a byte array. * * @param bytes the array * @param offs the array offset * @param len the number of bytes to include * @return the byte iterator */ public static ByteIterator ofBytes(final byte[] bytes, final int offs, final int len) { Assert.checkNotNullParam("bytes", bytes); if (len <= 0) { return EMPTY; } return new ByteArrayIterator(len, bytes, offs); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return bytes[offs + idx] & 0xff; }
public int previous() { if (! hasPrevious()) throw new NoSuchElementException(); return bytes[offs + -- idx] & 0xff; }
public ByteIterator doFinal(final Mac mac) throws IllegalStateException { update(mac); return ByteIterator.ofBytes(mac.doFinal()); }
public ByteIterator doFinal(final MessageDigest digest) throws IllegalStateException { update(digest); return ByteIterator.ofBytes(digest.digest()); }
public int next() { if (! hasNext()) throw new NoSuchElementException(); return bytes[offs + idx++] & 0xff; }
public ByteIterator doFinal(final MessageDigest digest) throws IllegalStateException { update(digest); return ByteIterator.ofBytes(digest.digest()); }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return bytes[offs + idx - 1] & 0xff; }
/** * Get a byte iterator for a byte array. * * @param bytes the array * @param offs the array offset * @param len the number of bytes to include * @return the byte iterator */ public static ByteIterator ofBytes(final byte[] bytes, final int offs, final int len) { Assert.checkNotNullParam("bytes", bytes); if (len <= 0) { return EMPTY; } return new ByteArrayIterator(len, bytes, offs); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return bytes[offs + idx] & 0xff; }
public ByteIterator doFinal(final Mac mac) throws IllegalStateException { update(mac); return ByteIterator.ofBytes(mac.doFinal()); }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return bytes[offs + idx - 1] & 0xff; }
/** * Get a byte iterator for a byte array. * * @param bytes the array * @param offs the array offset * @param len the number of bytes to include * @return the byte iterator */ public static ByteIterator ofBytes(final byte[] bytes, final int offs, final int len) { Assert.checkNotNullParam("bytes", bytes); if (len <= 0) { return EMPTY; } return new ByteArrayIterator(len, bytes, offs); }
public int next() { if (! hasNext()) throw new NoSuchElementException(); return bytes[offs + idx++] & 0xff; }
public ByteIterator doFinal(final MessageDigest digest) throws IllegalStateException { update(digest); return ByteIterator.ofBytes(digest.digest()); }
public int previous() { if (! hasPrevious()) throw new NoSuchElementException(); return bytes[offs + -- idx] & 0xff; }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return bytes[offs + idx] & 0xff; }
public ByteIterator doFinal(final Mac mac) throws IllegalStateException { update(mac); return ByteIterator.ofBytes(mac.doFinal()); }
public int previous() { if (! hasPrevious()) throw new NoSuchElementException(); return bytes[offs + -- idx] & 0xff; }
public int next() { if (! hasNext()) throw new NoSuchElementException(); return bytes[offs + idx++] & 0xff; }