diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2006-09-21 13:37:15 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2006-09-21 13:37:15 +0000 |
commit | 7808136ebc973a428fd488a0a18f259eea0e378f (patch) | |
tree | c1e1170ca7557028a615eb0d14de20d5d2c84c49 /test | |
parent | 35772d7e9838871792c5f94da425febc91cec01e (diff) | |
download | jackcess-7808136ebc973a428fd488a0a18f259eea0e378f.tar.gz jackcess-7808136ebc973a428fd488a0a18f259eea0e378f.zip |
make byte[] printable when dumping table
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@118 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'test')
-rw-r--r-- | test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java index a383b01..541f321 100644 --- a/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java +++ b/test/src/java/com/healthmarketscience/jackcess/DatabaseTest.java @@ -7,6 +7,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.math.BigDecimal; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; @@ -628,7 +629,17 @@ public class DatabaseTest extends TestCase { colNames.add(col.getName()); } writer.println("COLUMNS: " + colNames); - for(Object row : table) { + for(Map<String, Object> row : table) { + + // make byte[] printable + for(Map.Entry<String, Object> entry : row.entrySet()) { + Object v = entry.getValue(); + if(v instanceof byte[]) { + byte[] bv = (byte[])v; + entry.setValue(ByteUtil.toHexString(ByteBuffer.wrap(bv), bv.length)); + } + } + writer.println(row); } } |