out = new ByteCountingOutputStream(response.getOutputStream());
Object toMarshall = responseWrapper;
if (responseMediaType.getSubtype().equals("json")) {
toMarshall = responseWrapper.getResult();
}
marshaller.marshall(out, toMarshall, encoding, false);
logAccess(command,
context, bytesRead,
out.getCount(), requestMediaType,
responseMediaType, ResponseCode.Ok);
} finally {