public int next() { return ByteIterator.this.next(); }
public int next() throws NoSuchElementException { return table[ByteIterator.this.next()] & 0xff; }
public int next() throws NoSuchElementException { return table[ByteIterator.this.next()] & 0xff; }
public int next() { if (offset == size) { throw new NoSuchElementException(); } offset ++; return ByteIterator.this.next(); }
/** * Drain all the remaining bytes in this iterator to the given stream. * * @param stream the stream * @return the same stream */ public ByteArrayOutputStream drainTo(ByteArrayOutputStream stream) { while (hasNext()) { stream.write(next()); } return stream; }
public int read() throws IOException { return hasNext() ? next() : -1; }
/** * Drains up to {@code len} bytes from this iterator into the given {@code dst} array. * An attempt is made to drain as many as {@code len} bytes, but a smaller number may * be drained. * <p> * The number of bytes actually drained is returned as an integer. Unlike * {@link InputStream#read(byte[], int, int)}, this method never returns a negative result. * * @param dst the buffer into which the data is drained * @param offs the start offset in array {@code dst} at which the data is written. * @param len the maximum number of bytes to drain * @return the total number of bytes drained into {@code dst}, always greater or equal to {@code 0} */ public int drain(byte[] dst, int offs, int len) { for (int i = 0; i < len; i ++) { if (! hasNext()) return i; dst[offs + i] = (byte) next(); } return len; }
public int next() { int n = ByteIterator.this.peekNext(); if (isDelim(n)) { current = -1; throw new NoSuchElementException(); } offset ++; return current = ByteIterator.this.next(); }
/** * Determine if the remaining contents of this iterator are identical to the remaining contents of the other iterator. If the * contents are not equal, the iterators will be positioned at the location of the first difference. If the contents * are equal, the iterators will both be positioned at the end of their contents. * * @param other the other byte iterator * @return {@code true} if the contents are equal, {@code false} otherwise */ public final boolean contentEquals(ByteIterator other) { for (;;) { if (hasNext()) { if (! other.hasNext()) { return false; } if (next() != other.next()) { return false; } } else { return ! other.hasNext(); } } }
public int next() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); if (lo) { lo = false; return hex(b & 0xf); } else { b = ByteIterator.this.next(); lo = true; return hex(b >> 4); } }
int result = calc7(ByteIterator.this.peekPrev()); if (state == 9) { ByteIterator.this.next(); } else if (state == 0x11) { ByteIterator.this.next(); ByteIterator.this.next(); } else if (state == 0x19) { ByteIterator.this.next(); ByteIterator.this.next(); ByteIterator.this.next(); } else if (state == 0x21) { ByteIterator.this.next(); ByteIterator.this.next(); ByteIterator.this.next(); ByteIterator.this.next();
case 0: { assert ByteIterator.this.hasNext(); int b0 = ByteIterator.this.next(); c0 = calc0(b0); if (!ByteIterator.this.hasNext()) { return c0; int b1 = ByteIterator.this.next(); c1 = calc1(b0, b1); if (!ByteIterator.this.hasNext()) { return c0; int b2 = ByteIterator.this.next(); c2 = calc2(b1, b2); c3 = calc3(b2);
case 0: { assert ByteIterator.this.hasNext(); int b0 = ByteIterator.this.next(); c0 = calc0(b0); if (!ByteIterator.this.hasNext()) { return c0; int b1 = ByteIterator.this.next(); c1 = calc1(b0, b1); if (!ByteIterator.this.hasNext()) { return c0; int b2 = ByteIterator.this.next(); c2 = calc2(b1, b2); c3 = calc3(b2);
case 0: { assert ByteIterator.this.hasNext(); int b0 = ByteIterator.this.next(); c0 = calc0(b0); if (!ByteIterator.this.hasNext()) { return c0; int b1 = ByteIterator.this.next(); c1 = calc1(b0, b1); c2 = calc2(b1); return c0; int b2 = ByteIterator.this.next(); c3 = calc3(b1, b2); if (!ByteIterator.this.hasNext()) { return c0; int b3 = ByteIterator.this.next(); c4 = calc4(b2, b3); c5 = calc5(b3); int b4 = ByteIterator.this.next(); c6 = calc6(b3, b4); c7 = calc7(b4);
case 0: { assert ByteIterator.this.hasNext(); int b0 = ByteIterator.this.next(); c0 = calc0(b0); if (!ByteIterator.this.hasNext()) { return c0; int b1 = ByteIterator.this.next(); c1 = calc1(b0, b1); c2 = calc2(b1); return c0; int b2 = ByteIterator.this.next(); c3 = calc3(b1, b2); if (!ByteIterator.this.hasNext()) { return c0; int b3 = ByteIterator.this.next(); c4 = calc4(b2, b3); c5 = calc5(b3); int b4 = ByteIterator.this.next(); c6 = calc6(b3, b4); c7 = calc7(b4);