writeBuffer.writeShort(0);
}
if (keyLength > 0) {
writeBuffer.writeBytes(request.getUriBytes());
}
ChannelFutureListener releaseContentListener = null;
if (dataLength > 0) {
if (response instanceof XContentRestResponse) {
// if its a builder based response, and it was created with a CachedStreamOutput, we can release it
// after we write the response, and no need to do an extra copy because its not thread safe
XContentBuilder builder = ((XContentRestResponse) response).builder();