]> source.dussan.org Git - jackcess.git/commitdiff
write tdef page free space
authorJames Ahlborn <jtahlborn@yahoo.com>
Fri, 4 Aug 2006 12:08:31 +0000 (12:08 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Fri, 4 Aug 2006 12:08:31 +0000 (12:08 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@88 f203690c-595d-4dc9-a70b-905162fa7fd2

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

index 2506be33efdbee3697a3ba38d0aa5072dd889381..4b8f205f3db4d988b27f853cbbeccd7fa1352184 100644 (file)
@@ -326,8 +326,10 @@ public class Database {
     //End of tabledef
     buffer.put((byte) 0xff);
     buffer.put((byte) 0xff);
-    
-    buffer.putInt(8, buffer.position());  //Overwrite length of data for this page
+
+    int tableDefLen = buffer.position();
+    buffer.putShort(2, (short)(_format.PAGE_SIZE - tableDefLen - 8)); // overwrite page free space
+    buffer.putInt(8, tableDefLen);  //Overwrite length of data for this page
        
     //Write the tdef and usage map pages to disk.
     _pageChannel.writeNewPage(buffer);