case NEED_TASK:
clientEngine.getDelegatedTask().run();
break;
case NEED_WRAP:
ByteBuffer dst = ByteBuffer.allocate(1024*1024);
clientEngine.wrap(ByteBuffer.allocate(0), dst);
dst.flip();
byte[] output = new byte[clientOutput.length+dst.remaining()];
System.arraycopy(clientOutput,0,output,0,clientOutput.length);
dst.get(output, clientOutput.length, dst.remaining());
clientOutput = output;