Ejemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 public void write(final byte[] b, final int off, final int len) throws IOException {
   final ByteBuffer input = ByteBuffer.wrap(b, off, len);
   final int required = encoder.outputSize(len - off);
   if (output == null || output.capacity() < required) {
     output = CharBuffer.allocate(required);
   } else {
     output.clear();
   }
   encoder.encode(input, output);
   output.flip();
   writer.write(output.toString());
   writer.flush();
 }