code: protected final long plaintextLength(AbstractPutObjectRequest request,
                                           ObjectMetadata metadata) {
          if (request.getFile() != null) {
              return request.getFile().length();
          } else if (request.getInputStream() != null
                     && metadata.getRawMetadataValue(Headers.CONTENT_LENGTH) != null) {
              return metadata.getContentLength();
          }
          return -1;
      }
docs: Returns the plaintext length from the request and metadata; or -1 if
  unknown.