docs: private BosResponse uploadObject(PutObjectRequest request, InternalRequest internalRequest) {
          ObjectMetadata metadata = request.getObjectMetadata();
          InputStream input = request.getInputStream();
          if (request.getFile() != null) {
              File file = request.getFile();
  
              if (file.length() > 5 * 1024 * 1024 * 1024L) {
                  BceServiceException bse = new BceServiceException("Your proposed upload exceeds the maximum allowed "
                                                                    + "object size.");
                  bse.setStatusCode(400);
                  bse.setErrorCode("EntityTooLarge");
                  bse.setErrorType(BceServiceException.ErrorType.Client);
                  throw bse;
              }
  
              // Always set the content length, even if it's already set
              if (metadata.getContentLength() < 0) {
                  metadata.setContentLength(file.length());
              }
  
              if (metadata.getContentType() == null) {
                  metadata.setContentType(Mimetypes.getInstance().getMimetype(file));
              }
  
              if (metadata.getContentLength() == file.length()) {
                  FileInputStream fileInputStream = null;
                  try {
                      fileInputStream = new FileInputStream(file);
                      metadata.setBceContentSha256(
                              new String(Hex.encodeHex(HashUtils.computeSha256Hash(fileInputStream))));
                  } catch (Exception e) {
                      throw new BceClientException("Unable to calculate SHA-256 hash", e);
                  } finally {
                      try {
                          if (fileInputStream != null) {
                              fileInputStream.close();
                          }
                      } catch (Exception e) {
                          logger.warn("The inputStream accured error");
                      }
                  }
              }
              try {
                  internalRequest.setContent(new RestartableFileInputStream(file));
              } catch (FileNotFoundException e) {
                  throw new BceClientException("Unable to find file to upload", e);
              }
          } else {
              checkNotNull(input, "Either file or inputStream should be set.");
              if (metadata.getContentLength() < 0) {
                  logger.warn("No content length specified for stream data. Trying to read them all into memory.");
                  List<byte[]> data = this.readAll(input, metadata);
                  internalRequest.setContent(new RestartableMultiByteArrayInputStream(data, metadata.getContentLength()));
              } else if (input instanceof RestartableInputStream) {
                  internalRequest.setContent((RestartableInputStream) input);
              } else {
                  internalRequest.setContent(this.wrapRestartableInputStream(input));
              }
              if (metadata.getContentType() == null) {
                  metadata.setContentType(Mimetypes.getInstance().getMimetype(request.getKey()));
              }
          }
          if (request.getStorageClass() != null) {
              metadata.setStorageClass(request.getStorageClass());
          }
          internalRequest.addHeader(Headers.CONTENT_LENGTH, String.valueOf(metadata.getContentLength()));
  
          populateRequestMetadata(internalRequest, metadata);
  
          BosResponse response;
          try {
              response = this.invokeHttpClient(internalRequest, BosResponse.class);
          } finally {
              try {
                  internalRequest.getContent().close();
              } catch (Exception e) {
                  logger.warn("Fail to close input stream", e);
              }
          }
          return response;
      }