diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2011-04-06 02:17:24 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2011-04-06 02:17:24 +0000 |
commit | 84f7c316af6b1829a56b689b6babc3b6bd98d76d (patch) | |
tree | 8355ec38bd9713f2631994de0fa3331b61056e28 | |
parent | 748e2e82128b938b95ac74a30ae1315fac167bf8 (diff) | |
download | jackcess-84f7c316af6b1829a56b689b6babc3b6bd98d76d.tar.gz jackcess-84f7c316af6b1829a56b689b6babc3b6bd98d76d.zip |
add convenience method for debugging
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@548 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r-- | src/java/com/healthmarketscience/jackcess/ByteUtil.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/ByteUtil.java b/src/java/com/healthmarketscience/jackcess/ByteUtil.java index 6fe9d73..c15fc7a 100644 --- a/src/java/com/healthmarketscience/jackcess/ByteUtil.java +++ b/src/java/com/healthmarketscience/jackcess/ByteUtil.java @@ -441,6 +441,18 @@ public final class ByteUtil { } /** + * Convert the given number of bytes from the given database page to a + * hexidecimal string for display. + */ + public static String toHexString(Database db, int pageNumber, int size) + throws IOException + { + ByteBuffer buffer = db.getPageChannel().createPageBuffer(); + db.getPageChannel().readPage(buffer, pageNumber); + return toHexString(buffer, size); + } + + /** * Writes a sequence of hexidecimal values into the given buffer, where * every two characters represent one byte value. */ |