BufferPosition { public long incrementIndex() { _address = _parser.incrementIndex(_address, _buffers); return _address; } BufferPosition(BufferPositionParser parser, ByteBuffer[] buffers);  BufferPosition(long pos, BufferPositionParser parser, ByteBuffer[] buffers); boolean init(); void copy(BufferPosition rhs ); long getRealPosition(); int bufferIndex(); int bufferOffset(); long bufferGenId(); void setPosition(long address); void setPosition(long genId, int index, int offset); long getPosition(); @Override String toString(); long incrementGenId(); long incrementIndex(); long incrementOffset(int increment); long sanitize(); long sanitize(boolean okToRegress); @Override int hashCode(); @Override boolean equals(Object obj); boolean equals(BufferPosition position); boolean equalsIgnoreGenId(BufferPosition position); void skipOverFreeSpace(); static final String MODULE; static final Logger LOG; }
@Test public void testIncrementIndex() { ByteBuffer[] buffers = allocateByteBuffers(256, 256, 256, 99); BufferPositionParser parser = createParser(256, 256, 256, 99); BufferPosition pos = new BufferPosition(parser, buffers); pos.setPosition(123, 2, 100); pos.incrementIndex(); assertPosition(pos, 123, 3, 0); pos.incrementIndex(); assertPosition(pos, 124, 0, 0); }