List of utility methods to do Charset Encode
ByteBuffer | encode(CharBuffer in, CharsetEncoder encoder) encode int length = (int) (in.remaining() * (double) encoder .averageBytesPerChar()); ByteBuffer out = ByteBuffer.allocate(length); encoder.reset(); CoderResult flushResult = null; while (flushResult != CoderResult.UNDERFLOW) { CoderResult encodeResult = encoder.encode(in, out, true); if (encodeResult == CoderResult.OVERFLOW) { ... |