本文整理匯總了Java中org.apache.commons.codec.Charsets.ISO_8859_1屬性的典型用法代碼示例。如果您正苦於以下問題:Java Charsets.ISO_8859_1屬性的具體用法?Java Charsets.ISO_8859_1怎麽用?Java Charsets.ISO_8859_1使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.commons.codec.Charsets
的用法示例。
在下文中一共展示了Charsets.ISO_8859_1屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newStringIso8859_1
public static String newStringIso8859_1(byte[] bytes) {
return new String(bytes, Charsets.ISO_8859_1);
}
示例2: newStringIso8859_1
/**
* 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, may be {@code null}
* @return A new <code>String</code> decoded from the specified array of bytes using the ISO-8859-1 charset, or
* {@code null} if the input byte array was {@code null}.
* @throws NullPointerException
* Thrown if {@link Charsets#ISO_8859_1} is not initialized, which should never happen since it is
* required by the Java platform specification.
* @since As of 1.7, throws {@link NullPointerException} instead of UnsupportedEncodingException
*/
public static String newStringIso8859_1(final byte[] bytes) {
return new String(bytes, Charsets.ISO_8859_1);
}
示例3: newStringIso8859_1
/**
* 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, may be <code>null</code>
* @return A new <code>String</code> decoded from the specified array of bytes using the ISO-8859-1 charset, or
* <code>null</code> if the input byte array was <code>null</code>.
* @throws NullPointerException
* Thrown if {@link Charsets#ISO_8859_1} is not initialized, which should never happen since it is
* required by the Java platform specification.
* @since As of 1.7, throws {@link NullPointerException} instead of UnsupportedEncodingException
*/
public static String newStringIso8859_1(final byte[] bytes) {
return new String(bytes, Charsets.ISO_8859_1);
}