private ReadableStreamChannel setMetadataInResponseChannel(GetBlobResult result) {
      BlobInfo blobInfo = result.getBlobInfo();
      if (restRequest.getArgs().containsKey(SEND_USER_METADATA_AS_RESPONSE_BODY) && (boolean) restRequest.getArgs()
          .get(SEND_USER_METADATA_AS_RESPONSE_BODY)) {
        restResponseChannel.setHeader(Headers.CONTENT_TYPE, "application/octet-stream");
        restResponseChannel.setHeader(Headers.CONTENT_LENGTH, blobInfo.getUserMetadata().length);
        return new ByteBufferReadableStreamChannel(ByteBuffer.wrap(blobInfo.getUserMetadata()));
      } else {
        restResponseChannel.setHeader(Headers.CONTENT_LENGTH, 0);
        return new ByteBufferReadableStreamChannel(EMPTY_BUFFER);
      }
    }
Set metadata in response channel.
@param result result The result of the request i.e a {@link GetBlobResult} object with the properties of the blob.
@return a {@link ReadableStreamChannel} that represents the response to the {@code restRequest}.
ambry-frontend/src/main/java/com/github/ambry/frontend/GetBlobHandler.java