code: public byte[] encode(String s) throws IOException {
      if (s == null) {
        return null;
      }
  
      return s.getBytes(encoding);
    }
docs: Encode a string to an array of bytes.
  
  @param s the string to encode
  @return a bytearray containing the encoded string
  @throws IOException if something goes wrong