本文整理匯總了Java中org.apache.commons.codec.binary.StringUtils.newStringUsAscii方法的典型用法代碼示例。如果您正苦於以下問題:Java StringUtils.newStringUsAscii方法的具體用法?Java StringUtils.newStringUsAscii怎麽用?Java StringUtils.newStringUsAscii使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.codec.binary.StringUtils
的用法示例。
在下文中一共展示了StringUtils.newStringUsAscii方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
public String encode(String pString, String charset)
/* 194: */ throws UnsupportedEncodingException
/* 195: */ {
/* 196:382 */ if (pString == null) {
/* 197:383 */ return null;
/* 198: */ }
/* 199:385 */ return StringUtils.newStringUsAscii(encode(pString.getBytes(charset)));
/* 200: */ }
示例2: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
public String encode(String pString, String charset)
/* 127: */ throws UnsupportedEncodingException
/* 128: */ {
/* 129:224 */ if (pString == null) {
/* 130:225 */ return null;
/* 131: */ }
/* 132:227 */ return StringUtils.newStringUsAscii(encode(pString.getBytes(charset)));
/* 133: */ }
示例3: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
public String encode(String paramString1, String paramString2)
throws UnsupportedEncodingException
{
if (paramString1 == null)
return null;
return StringUtils.newStringUsAscii(encode(paramString1.getBytes(paramString2)));
}
示例4: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
public String encode(String str, Charset charset) {
if (str == null) {
return null;
}
return StringUtils.newStringUsAscii(encode(str.getBytes(charset)));
}
示例5: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
public String encode(String str, String charset) throws UnsupportedEncodingException {
if (str == null) {
return null;
}
return StringUtils.newStringUsAscii(encode(str.getBytes(charset)));
}
示例6: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
/**
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
* <p>
* Depending on the selection of the {@code strict} parameter, this function either implements the full ruleset
* or only a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521 and is suitable for encoding binary data and unformatted text.
*
* @param str
* string to convert to quoted-printable form
* @param charset
* the charset for str
* @return quoted-printable string
* @since 1.7
*/
public String encode(final String str, final Charset charset) {
if (str == null) {
return null;
}
return StringUtils.newStringUsAscii(this.encode(str.getBytes(charset)));
}
示例7: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
/**
* Encodes a string into its URL safe form using the specified string charset. Unsafe characters are escaped.
*
* @param str
* string to convert to a URL safe form
* @param charset
* the charset for str
* @return URL safe string
* @throws UnsupportedEncodingException
* Thrown if charset is not supported
*/
public String encode(final String str, final String charset) throws UnsupportedEncodingException {
if (str == null) {
return null;
}
return StringUtils.newStringUsAscii(encode(str.getBytes(charset)));
}
示例8: URLEncode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
public static String URLEncode(byte[] bytes) {
byte[] encodeURLBytes = URLCodec.encodeUrl(null, bytes);
String encodeURLtext = StringUtils.newStringUsAscii(encodeURLBytes);
return encodeURLtext;
}
示例9: encode
import org.apache.commons.codec.binary.StringUtils; //導入方法依賴的package包/類
/**
* Encodes a string into its quoted-printable form using the specified charset. Unsafe characters are escaped.
* <p>
* Depending on the selection of the {@code strict} parameter, this function either implements the full ruleset
* or only a subset of quoted-printable encoding specification (rule #1 and rule #2) as defined in
* RFC 1521 and is suitable for encoding binary data and unformatted text.
*
* @param str
* string to convert to quoted-printable form
* @param charset
* the charset for str
* @return quoted-printable string
* @since 1.7
*/
public String encode(final String str, final Charset charset) {
if (str == null) {
return null;
}
return StringUtils.newStringUsAscii(this.encode(StringUtils.getBytesUnchecked(str, charset.name())));
}