From: James Ahlborn Date: Thu, 3 Aug 2006 14:19:32 +0000 (+0000) Subject: use common row start/end reading methods X-Git-Tag: rel_1_1_6~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=20dcf1313fe8300ffcfbb344d10c944d1b63426e;p=jackcess.git use common row start/end reading methods git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@84 f203690c-595d-4dc9-a70b-905162fa7fd2 --- diff --git a/src/java/com/healthmarketscience/jackcess/UsageMap.java b/src/java/com/healthmarketscience/jackcess/UsageMap.java index 642470b..5a4adfc 100644 --- a/src/java/com/healthmarketscience/jackcess/UsageMap.java +++ b/src/java/com/healthmarketscience/jackcess/UsageMap.java @@ -77,14 +77,9 @@ public abstract class UsageMap { { ByteBuffer dataBuffer = pageChannel.createPageBuffer(); pageChannel.readPage(dataBuffer, pageNum); - short rowStart = dataBuffer.getShort(format.OFFSET_ROW_START + 2 * rowNum); - int rowEnd; - if (rowNum == 0) { - rowEnd = format.PAGE_SIZE - 1; - } else { - rowEnd = (dataBuffer.getShort(format.OFFSET_ROW_START + (rowNum - 1) * 2) & 0x0FFF) - 1; - } - dataBuffer.limit(rowEnd + 1); + short rowStart = Table.findRowStart(dataBuffer, rowNum, format); + int rowEnd = Table.findRowEnd(dataBuffer, rowNum, format); + dataBuffer.limit(rowEnd); byte mapType = dataBuffer.get(rowStart); UsageMap rtn; if (mapType == MAP_TYPE_INLINE) {