aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2010-10-30 00:05:10 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2010-10-30 00:05:10 +0000
commita311b66878b79e8027e2bc51b41e99a94223e13c (patch)
tree536a2df4be1e8eef6eb48b6bd2d4d38010137a33 /src/java
parent3afa433121854293413bd0835f8a63bbe7cccb30 (diff)
downloadjackcess-a311b66878b79e8027e2bc51b41e99a94223e13c.tar.gz
jackcess-a311b66878b79e8027e2bc51b41e99a94223e13c.zip
do not rewrap CharBuffer
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@493 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/healthmarketscience/jackcess/Column.java6
1 files 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<Column> {
/**
* @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);
}