예제 #1
0
 @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);
   }
 }
예제 #2
0
 @Override
 public int readerIndex() {
   return delegate.readerPosition();
 }
예제 #3
0
 @Override
 public void skipBytes(int length) {
   delegate.positionReader(delegate.readerPosition() + length);
 }
예제 #4
0
 @Override
 public boolean readable() {
   return delegate.writerPosition() > delegate.readerPosition();
 }