public void truncate(long size) { channel.truncate(size) ; }
@Override public void reposition(long posn) { if ( posn < 0 || posn > length() ) throw new IllegalArgumentException("reposition: Bad location: " + posn); flushOutputBuffer(); file.truncate(posn); filesize = posn; }
@Test public void storage_06() { ByteBuffer b1 = data(blkSize) ; store.write(b1) ; store.truncate(0) ; assertEquals(0, store.size()) ; // Check for: // http://bugs.sun.com/view_bug.do?bug_id=6191269 assertEquals(0, store.position()) ; }
@Test public void storage_06() { ByteBuffer b1 = data(blkSize) ; store.write(b1) ; store.truncate(0) ; assertEquals(0, store.size()) ; // Check for: // http://bugs.sun.com/view_bug.do?bug_id=6191269 assertEquals(0, store.position()) ; }