code: private static byte[] getBytes(String string, Charset charset) {
          if (string == null) {
              return null;
          }
          return string.getBytes(charset);
      }
docs: Calls {@link String#getBytes(Charset)}
  
  @param string
  The string to encode (if null, return null).
  @param charset
  The {@link Charset} to encode the {@code String}
  @return the encoded bytes