public static byte[] toBytes(String s) {
    try {
      return s.getBytes(UTF8_CSN);
    } catch (UnsupportedEncodingException e) {
      // should never happen!
      throw new IllegalArgumentException("UTF8 decoding is not supported", e);
    }
  }
Converts a string to a UTF-8 byte array.
@param s string
@return the byte array
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java