Work on ByteBufferIndexInput

ByteBuffer support class may have incorrect logic, untested