/** * Constructs a new <code>String</code> by decoding the specified array of bytes using the * ISO-8859-1 charset. * * @param bytes * The bytes to be decoded into characters * @return A new <code>String</code> decoded from the specified array of bytes using the given * charset. * @throws IllegalStateException * Thrown when a {@link UnsupportedEncodingException} is caught, which should never * happen since the charset is required. */ public static String newStringIso8859_1(final byte[] bytes) { return StringUtils.newString(bytes, CharEncoding.ISO_8859_1); }
/** * Constructs a new <code>String</code> by decoding the specified array of bytes using the * UTF-16 charset. * * @param bytes * The bytes to be decoded into characters * @return A new <code>String</code> decoded from the specified array of bytes using the given * charset. * @throws IllegalStateException * Thrown when a {@link UnsupportedEncodingException} is caught, which should never * happen since the charset is required. */ public static String newStringUtf16(final byte[] bytes) { return StringUtils.newString(bytes, CharEncoding.UTF_16); }
/** * Constructs a new <code>String</code> by decoding the specified array of bytes using the * UTF-16BE charset. * * @param bytes * The bytes to be decoded into characters * @return A new <code>String</code> decoded from the specified array of bytes using the given * charset. * @throws IllegalStateException * Thrown when a {@link UnsupportedEncodingException} is caught, which should never * happen since the charset is required. */ public static String newStringUtf16Be(final byte[] bytes) { return StringUtils.newString(bytes, CharEncoding.UTF_16BE); }
/** * Constructs a new <code>String</code> by decoding the specified array of bytes using the * US-ASCII charset. * * @param bytes * The bytes to be decoded into characters * @return A new <code>String</code> decoded from the specified array of bytes using the given * charset. * @throws IllegalStateException * Thrown when a {@link UnsupportedEncodingException} is caught, which should never * happen since the charset is required. */ public static String newStringUsAscii(final byte[] bytes) { return StringUtils.newString(bytes, CharEncoding.US_ASCII); }
/** * Constructs a new <code>String</code> by decoding the specified array of bytes using the * UTF-16LE charset. * * @param bytes * The bytes to be decoded into characters * @return A new <code>String</code> decoded from the specified array of bytes using the given * charset. * @throws IllegalStateException * Thrown when a {@link UnsupportedEncodingException} is caught, which should never * happen since the charset is required. */ public static String newStringUtf16Le(final byte[] bytes) { return StringUtils.newString(bytes, CharEncoding.UTF_16LE); }
/** * Constructs a new <code>String</code> by decoding the specified array of bytes using the UTF-8 * charset. * * @param bytes * The bytes to be decoded into characters * @return A new <code>String</code> decoded from the specified array of bytes using the given * charset. * @throws IllegalStateException * Thrown when a {@link UnsupportedEncodingException} is caught, which should never * happen since the charset is required. */ public static String newStringUtf8(final byte[] bytes) { return StringUtils.newString(bytes, CharEncoding.UTF_8); } }