@Override
public OutputStream writeStatusAndHeaders(long contentLength, ContainerResponse response) {
int responseStatus = response.getStatus();
serverResponse.setStatus(HttpResponseStatus.valueOf(responseStatus));
HttpResponseHeaders responseHeaders = serverResponse.getHeaders();
for(Map.Entry<String, List<Object>> header : response.getHttpHeaders().entrySet()){
responseHeaders.setHeader(header.getKey(), header.getValue());
}
return new ByteBufOutputStream(contentBuffer);
}
@Override