From: James Ahlborn Date: Fri, 21 Mar 2008 17:56:26 +0000 (+0000) Subject: truncate file before overwriting X-Git-Tag: rel_1_1_13~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=67acdb9068e0deba7004e0489ebaf5f82ad45a18;p=jackcess.git truncate file before overwriting git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@291 f203690c-595d-4dc9-a70b-905162fa7fd2 --- diff --git a/src/java/com/healthmarketscience/jackcess/Database.java b/src/java/com/healthmarketscience/jackcess/Database.java index 123445f..d3485d8 100644 --- a/src/java/com/healthmarketscience/jackcess/Database.java +++ b/src/java/com/healthmarketscience/jackcess/Database.java @@ -302,6 +302,7 @@ public class Database throws IOException { FileChannel channel = openChannel(mdbFile, false); + channel.truncate(0); channel.transferFrom(Channels.newChannel( Thread.currentThread().getContextClassLoader().getResourceAsStream( EMPTY_MDB)), 0, Integer.MAX_VALUE);