private char[] get14Buffer(byte[] data, String encoding) throws IOException {
if (!Charset.isSupported(encoding)) throw new IOException("Unsupported encoding " + encoding);
Charset charset = Charset.forName(encoding);
CharsetDecoder cd = charset.newDecoder().onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE);
int en = (int) (cd.maxCharsPerByte() * data.length);
char[] ca = new char[en];
ByteBuffer bb = ByteBuffer.wrap(data);
CharBuffer cb = CharBuffer.wrap(ca);
CoderResult cr = cd.decode(bb, cb, true);
if (!cr.isUnderflow()) {