code: protected String calculateContentHash(SignableRequest<?> request) {
          InputStream payloadStream = getBinaryRequestPayloadStream(request);
          ReadLimitInfo info = request.getReadLimitInfo();
          payloadStream.mark(info == null ? -1 : info.getReadLimit());
          String contentSha256 = BinaryUtils.toHex(hash(payloadStream));
          try {
              payloadStream.reset();
          } catch (IOException e) {
              throw new SdkClientException(
                      "Unable to reset stream after calculating AWS4 signature",
                      e);
          }
          return contentSha256;
      }
docs: Calculate the hash of the request's payload. Subclass could override this
  method to provide different values for "x-amz-content-sha256" header or
  do any other necessary set-ups on the request headers. (e.g. aws-chunked
  uses a pre-defined header value, and needs to change some headers
  relating to content-encoding and content-length.)