// Using String.getBytes to encode String to bytes String s = ...; byte [] b = s.getBytes( "8859_1" /* encoding */ );