public static Response mapToReceivedResponse(Response sentResponse) {
    Response receivedResponse;
    if (sentResponse instanceof GetResponse) {
      GetResponse getResponse = (GetResponse) sentResponse;
      receivedResponse = new GetResponse(getResponse.getCorrelationId(), getResponse.getClientId(),
          getResponse.getPartitionResponseInfoList(), new ByteBufInputStream(getResponse.getDataToSend().content()),
          getResponse.getError());
    } else {
      receivedResponse = sentResponse;
    }
    return receivedResponse;
  }
This method is applicable when we are processing responses received from Azure APIs in Frontend via {@link LocalNetworkClient}.
The responses received from Azure are constructed as java objects such as {@link GetResponse}, {@link PutResponse} in
AmbryRequests class methods from {@link com.github.ambry.protocol.RequestHandler}
threads running within the Frontend itself. The content in these responses is available as buffer but we access it
as stream in the Frontend router. Hence, we create new Response objects by having a stream enclose the buffer.

At the moment, only {@link GetResponse} carries content and needs to be constructed again as below. Other responses
like {@link PutResponse}, {@link DeleteResponse}, etc which don't carry any content don't need to be reconstructed
and can be referenced as they are.
@param sentResponse {@link Response} object constructed at sender side.
@return {@link Response} object constructed at receiver side.
ambry-router/src/main/java/com/github/ambry/router/RouterUtils.java