public static byte[] toBytesUTF8(String x){
  try {
    return x.getBytes(PngHelperInternal.charsetUTF8name);
  }
 catch (  UnsupportedEncodingException e) {
    throw new PngBadCharsetException(e);
  }
}

public static byte [ ] toBytesUTF8 ( String x ) { try { return x . getBytes ( PngHelperInternal . charsetUTF8name ) ; } catch ( UnsupportedEncodingException e ) { throw new PngBadCharsetException ( e ) ; } }
converts to bytes using utf - 8
