From 8d3f85d572cfe3f04ae4999bfdc6b7fc1ae4c3f8 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Tue, 8 Aug 2006 11:57:12 +0000 Subject: [PATCH] allow reading multi-page memos git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@98 f203690c-595d-4dc9-a70b-905162fa7fd2 --- .../healthmarketscience/jackcess/Column.java | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/java/com/healthmarketscience/jackcess/Column.java b/src/java/com/healthmarketscience/jackcess/Column.java index 2f0bf23..3f779c1 100644 --- a/src/java/com/healthmarketscience/jackcess/Column.java +++ b/src/java/com/healthmarketscience/jackcess/Column.java @@ -271,7 +271,7 @@ public class Column implements Comparable { return readCurrencyValue(data); } else if (_type == DataType.OLE) { if (data.length > 0) { - return readLongBinaryValue(data, null); + return readLongBinaryValue(data); } else { return null; } @@ -298,7 +298,7 @@ public class Column implements Comparable { * LONG_VALUE_TYPE_* * @return The LVAL data */ - private byte[] readLongBinaryValue(byte[] lvalDefinition, byte[] outType) + private byte[] readLongBinaryValue(byte[] lvalDefinition) throws IOException { ByteBuffer def = ByteBuffer.wrap(lvalDefinition); @@ -387,10 +387,6 @@ public class Column implements Comparable { default: throw new IOException("Unrecognized long value type: " + type); } - if(outType != null) { - // return parsed type as well - outType[0] = type; - } return rtn; } @@ -401,26 +397,11 @@ public class Column implements Comparable { private String readLongStringValue(byte[] lvalDefinition) throws IOException { - byte[] type = new byte[1]; - byte[] binData = readLongBinaryValue(lvalDefinition, type); + byte[] binData = readLongBinaryValue(lvalDefinition); if(binData == null) { return null; } - String result = null; - switch (type[0]) { - case LONG_VALUE_TYPE_OTHER_PAGE: - result = decodeTextValue(binData); - break; - case LONG_VALUE_TYPE_THIS_PAGE: - result = decodeTextValue(binData); - break; - case LONG_VALUE_TYPE_OTHER_PAGES: - //XXX - return null; - default: - throw new IOException("Unrecognized long value type: " + type); - } - return result; + return decodeTextValue(binData); } /** -- 2.39.5