diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2006-09-26 14:39:18 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2006-09-26 14:39:18 +0000 |
commit | 0346306296d835f008f890ac9ad9826797254b91 (patch) | |
tree | 89851e409db61204ffeb98a01770f2e3c866f7aa /src/java/com | |
parent | 0fbd0d45ecfcb310452b246824883e74241de39f (diff) | |
download | jackcess-0346306296d835f008f890ac9ad9826797254b91.tar.gz jackcess-0346306296d835f008f890ac9ad9826797254b91.zip |
fail more gracefully if writing large index
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@125 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java/com')
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/Index.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Index.java b/src/java/com/healthmarketscience/jackcess/Index.java index 43d9888..602bd5f 100644 --- a/src/java/com/healthmarketscience/jackcess/Index.java +++ b/src/java/com/healthmarketscience/jackcess/Index.java @@ -259,7 +259,7 @@ public class Index implements Comparable<Index> { buffer.putInt(0); //Next page buffer.putInt(0); //Leaf page buffer.putInt(0); //Unknown - buffer.put((byte) 0); //Unknown + buffer.put((byte) 0); // compressed byte count buffer.put((byte) 0); //Unknown buffer.put((byte) 0); //Unknown byte[] entryMask = new byte[_format.SIZE_INDEX_ENTRY_MASK]; @@ -270,6 +270,10 @@ public class Index implements Comparable<Index> { int size = entry.size(); totalSize += size; int idx = totalSize / 8; + if(idx >= entryMask.length) { + throw new UnsupportedOperationException( + "FIXME cannot write large index yet"); + } entryMask[idx] |= (1 << (totalSize % 8)); } buffer.put(entryMask); |