本文整理汇总了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())));
}