@Override public void setLength(long newLength) throws IOException { raos.setLength(newLength); }
@Override public synchronized void setLength(long newLength) throws IOException { // Flush before changing the file's length, otherwise the behavior of setLength() would be modified, especially // when truncating the file flush(); raos.setLength(newLength); }
/** * Validates that FileMonitor properly reports {@link FileMonitor#SIZE_ATTRIBUTE} changes when a file's size changes. * * @throws IOException should not normally happen */ @Test public void testSizeAttribute() throws IOException { setUp(SIZE_ATTRIBUTE); RandomAccessOutputStream raos = file.getRandomAccessOutputStream(); try { raos.setLength(10); assert hasAttributeChanged(SIZE_ATTRIBUTE); raos.setLength(0); } finally { if(raos!=null) raos.close(); } }
raos.setLength(raos.getOffset());
raos.setLength(raos.getOffset());
raos.setLength(raos.getOffset());
((RandomAccessOutputStream)mkfileOut).setLength(allocateSpace);