@Override public int indexOf(int fromIndex, int toIndex, byte value) { int pos = delegate.positionReader(fromIndex); try { while (delegate.readerPosition() < toIndex) { int thisPos = delegate.readerPosition(); if (delegate.get() == value) { return thisPos; } } return -1; } catch (ReadPastEndException e) { throw new RuntimeException(e); } finally { delegate.positionReader(pos); } }
@Override public int readerIndex() { return delegate.readerPosition(); }
@Override public void skipBytes(int length) { delegate.positionReader(delegate.readerPosition() + length); }
@Override public boolean readable() { return delegate.writerPosition() > delegate.readerPosition(); }