本文整理了Java中java.nio.charset.Charset.contains()
方法的一些代码示例,展示了Charset.contains()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Charset.contains()
方法的具体详情如下:
包路径:java.nio.charset.Charset
类名称:Charset
方法名:contains
[英]Determines whether this charset is a superset of the given charset. A charset C1 contains charset C2 if every character representable by C2 is also representable by C1. This means that lossless conversion is possible from C2 to C1 (but not necessarily the other way round). It does not imply that the two charsets use the same byte sequences for the characters they share.
Note that this method is allowed to be conservative, and some implementations may return false when this charset does contain the other charset. Android's implementation is precise, and will always return true in such cases.
[中]确定此字符集是否为给定字符集的超集。如果每个可由C2表示的字符也可由C1表示,则字符集C1包含字符集C2。这意味着可以从C2到C1进行无损转换(但不一定相反)。这并不意味着这两个字符集对它们共享的字符使用相同的字节序列。
请注意,此方法是保守的,当此字符集不包含其他字符集时,某些实现可能返回false。Android的实现是精确的,在这种情况下总是会返回true。
代码示例来源:origin: line/armeria
if (charset.contains(StandardCharsets.UTF_8)) {
if (result instanceof Publisher) {
return aggregateFrom((Publisher<?>) result, headers, trailingHeaders,
代码示例来源:origin: net.sf.jmatchparser/jMatchParser-charset
@Override
public boolean contains(Charset cs) {
return cs instanceof UTF8BinaryCharset || UTF_8.contains(cs);
}
代码示例来源:origin: org.ec4j.core/ec4j-core
/** {@inheritDoc} */
@Override
public boolean contains(Charset cs) {
return delegate.contains(cs);
}
代码示例来源:origin: com.anrisoftware.globalpom/globalpomutils-core
/**
* @see Charset#contains(Charset)
* @since 2.6
*/
public boolean contains(Charset cs) {
return charset.contains(cs);
}
代码示例来源:origin: teiid/teiid
@Override
public boolean contains(Charset cs) {
return Streamable.CHARSET.contains(cs);
}
};
代码示例来源:origin: net.sf.jmatchparser/jMatchParser-charset
@Override
public boolean contains(Charset cs) {
return cs instanceof AddBOMCharset || base.contains(cs);
}
代码示例来源:origin: org.netbeans.api/org-netbeans-modules-queries
@Override
public boolean contains(Charset charset) {
return this.delegates.get(0).contains(charset);
}
代码示例来源:origin: org.gradle/gradle-core
private boolean defaultEncodingContainsPlatformEncoding() {
// sun.jnu.encoding is the platform encoding used to decode/encode file paths, command line arguments, etc.
// it's derived from LANG/LC_ALL/LC_CTYPE on Unixes and should not be set by the user
String platformEncoding = System.getProperty("sun.jnu.encoding");
Charset platformCharset = platformEncoding != null && Charset.isSupported(platformEncoding) ? Charset.forName(platformEncoding) : null;
// fallback to require UTF-8 when platformCharset cannot be resolved
Charset requiredCharset = platformCharset != null ? platformCharset : Charsets.UTF_8;
return Charset.defaultCharset().contains(requiredCharset);
}
}
代码示例来源:origin: org.vesalainen.lpg/lpg
private static boolean canUseUsAscii(Charset cs, EnumSet<ParserFeature> features)
{
return ( StandardCharsets.US_ASCII.contains(cs) &&
!(
features.contains(UseModifiableCharset) ||
features.contains(UpperCase) ||
features.contains(LowerCase) ||
features.contains(UsePushback) ||
features.contains(UseInclude)
)
);
}
代码示例来源:origin: net.sf.jmatchparser/jMatchParser-charset
@Override
public boolean contains(Charset cs) {
return cs.name() == this.name() || fallback.contains(cs);
}
代码示例来源:origin: org.apache.optiq/optiq-core
charset = charset1;
collation = collation1;
} else if (charset1.contains(charset2)) {
charset = charset1;
collation = collation1;
代码示例来源:origin: net.hydromatic/optiq
charset = charset1;
collation = collation1;
} else if (charset1.contains(charset2)) {
charset = charset1;
collation = collation1;
代码示例来源:origin: Qihoo360/Quicksql
charset = charset1;
collation = collation1;
} else if (charset1.contains(charset2)) {
charset = charset1;
collation = collation1;
代码示例来源:origin: org.apache.calcite/calcite-core
charset = charset1;
collation = collation1;
} else if (charset1.contains(charset2)) {
charset = charset1;
collation = collation1;
内容来源于网络,如有侵权,请联系作者删除!