public static String getString(byte[] bytes, String encoding) {
        try {
            return new String(bytes, encoding);
        } catch(UnsupportedEncodingException e) {
            throw new IllegalArgumentException(encoding + " is not a known encoding name.", e);
        }
    }
public static String getString ( byte [ ] bytes , String encoding ) { try { return new String ( bytes , encoding ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( encoding + " is not a known encoding name." , e ) ; } }
Create a string from bytes using the given encoding

@param bytes The bytes to create a string from
@param encoding The encoding of the string
@return The created string