code: public static final byte[] getBytes(String input) {
          byte output[] = null;
          try {
              if (input != null) {
                  output = input.getBytes("UTF-8");
              }
          } catch (UnsupportedEncodingException e) {
              // This should not happen.
              // If it happens, it would be some runtime or operating system issue, so just give up and return null.
              // ffdc data will be logged automatically.
          }
          return output;
      }
docs: Converts a String to a byte array by using UTF-8 character sets.
  This code is needed even converting US-ASCII characters since there are some character sets which are not compatible with US-ASCII code area.
  For example, CP-1399, which is z/OS Japanese EBCDIC character sets, is one.
  @param input String, may be {@code null}.
  @return byte array representing the String or {@code null} if the String was null or contained non ASCII character.