/** * Get a sub-iterator that is delimited by the given bytes. The returned iterator offset starts at 0 and cannot * be backed up before that point. The returned iterator will return {@code false} for {@code hasNext()} if the next * character in the encapsulated iterator is a delimiter or if the underlying iterator returns {@code false} for * {@code hasNext()}. * * @param delims the byte delimiters * @return the sub-iterator */ public final ByteIterator delimitedBy(final int... delims) { if ((delims == null) || (delims.length == 0) || ! hasNext()) { return EMPTY; } for (int delim : delims) { if (delim < 0 || delim > 0xff) { return EMPTY; } } return new DelimitedByteIterator(this, delims); }
public int next() { if (! hasNext()) throw new NoSuchElementException(); offset++; return iter.next(); }
public int previous() { if (! hasPrevious()) throw new NoSuchElementException(); offset--; return iter.previous(); }
public boolean hasNext() { return iter.hasNext() && ! isDelim(iter.peekNext()); }
public boolean hasNext() { return iter.hasNext() && ! isDelim(iter.peekNext()); }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return iter.peekPrevious(); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return iter.peekNext(); }
public boolean hasNext() { return iter.hasNext() && ! isDelim(iter.peekNext()); }
/** * Get a sub-iterator that is delimited by the given bytes. The returned iterator offset starts at 0 and cannot * be backed up before that point. The returned iterator will return {@code false} for {@code hasNext()} if the next * character in the encapsulated iterator is a delimiter or if the underlying iterator returns {@code false} for * {@code hasNext()}. * * @param delims the byte delimiters * @return the sub-iterator */ public final ByteIterator delimitedBy(final int... delims) { if ((delims == null) || (delims.length == 0) || ! hasNext()) { return EMPTY; } for (int delim : delims) { if (delim < 0 || delim > 0xff) { return EMPTY; } } return new DelimitedByteIterator(this, delims); }
public int previous() { if (! hasPrevious()) throw new NoSuchElementException(); offset--; return iter.previous(); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return iter.peekNext(); }
/** * Get a sub-iterator that is delimited by the given bytes. The returned iterator offset starts at 0 and cannot * be backed up before that point. The returned iterator will return {@code false} for {@code hasNext()} if the next * character in the encapsulated iterator is a delimiter or if the underlying iterator returns {@code false} for * {@code hasNext()}. * * @param delims the byte delimiters * @return the sub-iterator */ public final ByteIterator delimitedBy(final int... delims) { if ((delims == null) || (delims.length == 0) || ! hasNext()) { return EMPTY; } for (int delim : delims) { if (delim < 0 || delim > 0xff) { return EMPTY; } } return new DelimitedByteIterator(this, delims); }
public int previous() { if (! hasPrevious()) throw new NoSuchElementException(); offset--; return iter.previous(); }
public int next() { if (! hasNext()) throw new NoSuchElementException(); offset++; return iter.next(); }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return iter.peekPrevious(); }
public int peekNext() throws NoSuchElementException { if (! hasNext()) throw new NoSuchElementException(); return iter.peekNext(); }
public int peekPrevious() throws NoSuchElementException { if (! hasPrevious()) throw new NoSuchElementException(); return iter.peekPrevious(); }
public int next() { if (! hasNext()) throw new NoSuchElementException(); offset++; return iter.next(); }