summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2012-06-14 03:49:44 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2012-06-14 03:49:44 +0000
commitecb46de7fd6e55b83e2b0babd19a77f175f015b3 (patch)
treebc7fe71961b187911c62fa306858ce40634f322e /src
parentacdd431dcf6417e90c01429fb546a08c541e0676 (diff)
downloadjackcess-ecb46de7fd6e55b83e2b0babd19a77f175f015b3.tar.gz
jackcess-ecb46de7fd6e55b83e2b0babd19a77f175f015b3.zip
reset position/limit after encoding page
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@630 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src')
-rw-r--r--src/java/com/healthmarketscience/jackcess/PageChannel.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/PageChannel.java b/src/java/com/healthmarketscience/jackcess/PageChannel.java
index 8759fcf..ae30ba7 100644
--- a/src/java/com/healthmarketscience/jackcess/PageChannel.java
+++ b/src/java/com/healthmarketscience/jackcess/PageChannel.java
@@ -243,10 +243,12 @@ public class PageChannel implements Channel, Flushable {
// re-encode page
encodedPage = _codecHandler.encodePage(page, pageNumber, pageOffset);
+
+ // reset position/limit in case they were affected by encoding
+ encodedPage.position(pageOffset).limit(pageOffset + writeLen);
}
try {
- encodedPage.position(pageOffset);
_channel.write(encodedPage, (getPageOffset(pageNumber) + pageOffset));
if(_autoSync) {
flush();