Example usage for org.apache.cassandra.io.util RandomAccessReader reset

List of usage examples for org.apache.cassandra.io.util RandomAccessReader reset

Introduction

In this page you can find the example usage for org.apache.cassandra.io.util RandomAccessReader reset.

Prototype

public void reset(DataPosition mark) 

Source Link

Usage

From source file:com.fullcontact.cassandra.io.util.BufferedRandomAccessFileTest.java

License:Apache License

@Test
public void testBytesPastMark() throws IOException {
    File tmpFile = File.createTempFile("overflowtest", "bin");
    tmpFile.deleteOnExit();//w ww.ja va  2  s . c o  m

    // Create the BRAF by filename instead of by file.
    final RandomAccessReader r = RandomAccessReader.open(new Path(new File(tmpFile.getPath()).getPath()), fs);
    assert tmpFile.getPath().equals(r.getPath());

    // Create a mark and move the rw there.
    final FileMark mark = r.mark();
    r.reset(mark);

    // Expect this call to succeed.
    r.bytesPastMark(mark);
}