code: protected final PutObjectRequest updateInstructionPutRequest(
          PutObjectRequest req, ContentCryptoMaterial cekMaterial) {
          byte[] bytes =  cekMaterial.toJsonString(cryptoConfig.getCryptoMode())
                                     .getBytes(UTF8);
          ObjectMetadata metadata = req.getMetadata();
          if (metadata == null) {
              metadata = new ObjectMetadata();
              req.setMetadata(metadata);
          }
          // Set the content-length of the upload
          metadata.setContentLength(bytes.length);
          // Set the crypto instruction file header
          metadata.addUserMetadata(Headers.CRYPTO_INSTRUCTION_FILE, "");
          // Update the instruction request
          req.setMetadata(metadata);
          req.setInputStream(new ByteArrayInputStream(bytes));
          // the file attribute in the request is always null before calling this
          // routine
          return req;
      }
docs: Updates put request to store the specified instruction object in S3.
  
  @param req
  The put-instruction-file request for the instruction file to
  be stored in S3.
  @param cekMaterial
  The instruction object to be stored in S3.
  @return A put request to store the specified instruction object in S3.