code: public void write(License license, IOFormat format) throws IOException {
          switch (format) {
              case BINARY:
                  os.write(license.serialized());
                  return;
              case BASE64:
                  os.write(Base64.getEncoder().encode(license.serialized()));
                  return;
              case STRING:
                  os.write(license.toString().getBytes(StandardCharsets.UTF_8));
                  return;
          }
          throw new IllegalArgumentException("License format " + format + " is unknown");
      }
docs: Write the license into the output.
  
  @param license the license itself
  @param format  the desired format of the license, can be {@link IOFormat#STRING},
  {@link IOFormat#BASE64} or {@link IOFormat#BINARY}
  @throws IOException if the output cannot be written