示例#1
0
 @Override
 public void prepend(char[] chars, int offset, int length, IUnitChain unitChain) {
   final ICharsetCodec cc = CharsetCodec.get(m_charsetName);
   try (BytesBuilder bb = BytesBuilder.get()) {
     cc.encode(chars, offset, length, bb);
     length = bb.length();
     IUnit unit = Util.firstUnit(unitChain);
     while ((length -= Helper.prepend(bb, 0, length, unit)) > 0)
       unit = Util.prependNewUnit(unitChain);
   }
 }
示例#2
0
 @Override
 public void write(char[] chars, int offset, int length, IUnitChain unitChain) {
   final ICharsetCodec cc = CharsetCodec.get(m_charsetName);
   Helper.write(cc, CharBuffer.wrap(chars, offset, length), unitChain);
 }