/** * Get a byte iterator for a byte buffer. The buffer's position is kept up to date with the number of bytes * consumed by the iterator. The iterator cannot be moved before the position that the buffer had when the * iterator was constructed (this position is considered the zero offset). * * @param buffer the byte buffer (must not be {@code null}) * @return the byte iterator (not {@code null}) */ public static ByteIterator ofByteBuffer(ByteBuffer buffer) { Assert.checkNotNullParam("buffer", buffer); return new ByteBufferIterator(buffer); }
public int next() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return buffer.get() & 0xff; }
public int previous() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); buffer.position(buffer.position() - 1); return peekNext(); }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return buffer.get(buffer.position() - 1) & 0xff; }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return buffer.get(buffer.position() - 1) & 0xff; }
public int previous() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); buffer.position(buffer.position() - 1); return peekNext(); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return buffer.get(buffer.position()) & 0xff; }
/** * Get a byte iterator for a byte buffer. The buffer's position is kept up to date with the number of bytes * consumed by the iterator. The iterator cannot be moved before the position that the buffer had when the * iterator was constructed (this position is considered the zero offset). * * @param buffer the byte buffer (must not be {@code null}) * @return the byte iterator (not {@code null}) */ public static ByteIterator ofByteBuffer(ByteBuffer buffer) { Assert.checkNotNullParam("buffer", buffer); return new ByteBufferIterator(buffer); }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return buffer.get(buffer.position() - 1) & 0xff; }
public int previous() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); buffer.position(buffer.position() - 1); return peekNext(); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return buffer.get(buffer.position()) & 0xff; }
/** * Get a byte iterator for a byte buffer. The buffer's position is kept up to date with the number of bytes * consumed by the iterator. The iterator cannot be moved before the position that the buffer had when the * iterator was constructed (this position is considered the zero offset). * * @param buffer the byte buffer (must not be {@code null}) * @return the byte iterator (not {@code null}) */ public static ByteIterator ofByteBuffer(ByteBuffer buffer) { Assert.checkNotNullParam("buffer", buffer); return new ByteBufferIterator(buffer); }
public int next() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return buffer.get() & 0xff; }
public int next() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return buffer.get() & 0xff; }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return buffer.get(buffer.position()) & 0xff; }