protected byte[] getBinaryRequestPayloadWithoutQueryParams(SignableRequest<?> request) {
        InputStream content = getBinaryRequestPayloadStreamWithoutQueryParams(request);

        try {
            ReadLimitInfo info = request.getReadLimitInfo();
            content.mark(info == null ? -1 : info.getReadLimit());
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            byte[] buffer = new byte[1024 * 5];
            while (true) {
                int bytesRead = content.read(buffer);
                if (bytesRead == -1) break;

                byteArrayOutputStream.write(buffer, 0, bytesRead);
            }

            byteArrayOutputStream.close();
            content.reset();

            return byteArrayOutputStream.toByteArray();
        } catch (Exception e) {
            throw new SdkClientException("Unable to read request payload to sign request: " + e.getMessage(), e);
        }
    }
Returns the request's payload contents as binary data, without processing
any query string params (i.e. no form encoding for query params).

@param request
           The request
@return The request's payload contents as binary data, not including any
        form encoding of query string params.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/AbstractAWSSigner.java