當前位置: 首頁>>代碼示例>>Java>>正文


Java Charsets.UTF_16BE屬性代碼示例

本文整理匯總了Java中org.apache.commons.codec.Charsets.UTF_16BE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Charsets.UTF_16BE屬性的具體用法?Java Charsets.UTF_16BE怎麽用?Java Charsets.UTF_16BE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.commons.codec.Charsets的用法示例。


在下文中一共展示了Charsets.UTF_16BE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: newStringUtf16Be

public static String newStringUtf16Be(byte[] bytes) {
    return new String(bytes, Charsets.UTF_16BE);
}
 
開發者ID:Qwaz,項目名稱:solved-hacking-problem,代碼行數:3,代碼來源:StringUtils.java

示例2: newStringUtf16Be

/**
 * 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 UTF-16BE charset,
 *         or {@code null} if the input byte array was {@code null}.
 * @throws NullPointerException
 *             Thrown if {@link Charsets#UTF_16BE} 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 newStringUtf16Be(final byte[] bytes) {
    return new String(bytes, Charsets.UTF_16BE);
}
 
開發者ID:Becavalier,項目名稱:QRDataTransfer-Android,代碼行數:15,代碼來源:StringUtils.java

示例3: newStringUtf16Be

/**
 * 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 UTF-16BE charset,
 *         or <code>null</code> if the input byte array was <code>null</code>.
 * @throws NullPointerException
 *             Thrown if {@link Charsets#UTF_16BE} 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 newStringUtf16Be(final byte[] bytes) {
    return new String(bytes, Charsets.UTF_16BE);
}
 
開發者ID:Its-its,項目名稱:AltManager,代碼行數:15,代碼來源:StringUtils.java


注:本文中的org.apache.commons.codec.Charsets.UTF_16BE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。