Exception exception = null;
final TransformationResult<E, Buffer> result =
encoder.transform(connection, object);
final Status status = result.getStatus();
if (status == Status.COMPLETE) {
output.write(result.getMessage());
if (completionHandler != null) {
completionHandler.completed(this);
}