public static Pair<Pair<ServerErrorCode, InputStream>, GetResponse> decodeGetResponse(ResponseInfo responseInfo,
      ClusterMap clusterMap) throws Exception {
    InputStream serverResponseStream = new NettyByteBufDataInputStream(responseInfo.content());
    GetResponse getResponse = GetResponse.readFrom(new DataInputStream(serverResponseStream), clusterMap);
    ServerErrorCode partitionErrorCode = getResponse.getPartitionResponseInfoList().get(0).getErrorCode();
    ServerErrorCode errorCode =
        partitionErrorCode == ServerErrorCode.NoError ? getResponse.getError() : partitionErrorCode;
    InputStream stream = errorCode == ServerErrorCode.NoError ? getResponse.getInputStream() : null;
    return new Pair<>(new Pair<>(errorCode, stream), getResponse);
  }
Decodes the stream from given responseInfo to get {@link GetResponse}

@param responseInfo {@link ResponseInfo} responseInfo
@param clusterMap {@link ClusterMap} clusterMap
@return serverErrorCode, InputStream, GetResponse
@throws Exception exception
ambry-tools/src/main/java/com/github/ambry/tools/util/ToolRequestResponseUtil.java