]> source.dussan.org Git - jackcess.git/commitdiff
truncate file before overwriting
authorJames Ahlborn <jtahlborn@yahoo.com>
Fri, 21 Mar 2008 17:56:26 +0000 (17:56 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Fri, 21 Mar 2008 17:56:26 +0000 (17:56 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@291 f203690c-595d-4dc9-a70b-905162fa7fd2

src/java/com/healthmarketscience/jackcess/Database.java

index 123445f83b7393ccded9d7266bc197bea2d28b23..d3485d8415e9543a25d25fc8403df3667956a851 100644 (file)
@@ -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);