134135136137138139140141142143144
throws EncodingException { final int textLength = text.getLength(); if (buffer == null) { buffer = new ByteBuffer(textLength); } else if (buffer.getLength() < textLength) { buffer.ensureSize(textLength); }
7374757677787980818283
public ByteBuffer encode(final CodePointBuffer text, ByteBuffer buffer) { final int textLength = text.getLength(); if (buffer == null) { buffer = new ByteBuffer(textLength); } else if (buffer.getLength() < textLength) { buffer.ensureSize(textLength); }
161162163164165166167168169
} else { enc = EncodingRegistry.getInstance().getEncoding(encoding); } final ByteBuffer byteBuffer = new ByteBuffer(data, pos, length); final CodePointBuffer cp = enc.decode(byteBuffer, null); return Utf16LE.getInstance().encodeString(cp); }