From 20dcf1313fe8300ffcfbb344d10c944d1b63426e Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Thu, 3 Aug 2006 14:19:32 +0000 Subject: [PATCH] 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 --- .../com/healthmarketscience/jackcess/UsageMap.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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) { -- 2.39.5