code: public PutObjectResponse putObject(String bucketName, String key, byte[] value, ObjectMetadata metadata) {
          if (metadata.getContentLength() == -1) {
              metadata.setContentLength(value.length);
          }
          return this.putObject(new PutObjectRequest(bucketName, key, RestartableInputStream.wrap(value), metadata));
      }
docs: Uploads the specified bytes and object metadata to Bos under the specified bucket and key name.
  
  @param bucketName The name of an existing bucket, to which you have Write permission.
  @param key The key under which to store the specified file.
  @param value The bytes containing the value to be uploaded to Bos.
  @param metadata Additional metadata instructing Bos how to handle the uploaded data
  (e.g. custom user metadata, hooks for specifying content type, etc.).
  @return A PutObjectResponse object containing the information returned by Bos for the newly created object.