git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@493
f203690c-595d-4dc9-a70b-
905162fa7fd2
/**
* @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);
}