From a311b66878b79e8027e2bc51b41e99a94223e13c Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Sat, 30 Oct 2010 00:05:10 +0000 Subject: [PATCH] do not rewrap CharBuffer git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@493 f203690c-595d-4dc9-a70b-905162fa7fd2 --- src/java/com/healthmarketscience/jackcess/Column.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/com/healthmarketscience/jackcess/Column.java b/src/java/com/healthmarketscience/jackcess/Column.java index 666fa1e..1eba865 100644 --- a/src/java/com/healthmarketscience/jackcess/Column.java +++ b/src/java/com/healthmarketscience/jackcess/Column.java @@ -1386,13 +1386,15 @@ public class Column implements Comparable { /** * @param text Text to encode - * @param db relevant db + * @param charset database charset * @return A buffer with the text encoded */ public static ByteBuffer encodeUncompressedText(CharSequence text, Charset charset) { - return charset.encode(CharBuffer.wrap(text)); + CharBuffer cb = ((text instanceof CharBuffer) ? + (CharBuffer)text : CharBuffer.wrap(text)); + return charset.encode(cb); } -- 2.39.5