语言

CharsetDecoder.DetectedCharset 方法

定义

检索此解码器  检测到的字符集; (可选操作) 。

[Android.Runtime.Register("detectedCharset", "()Ljava/nio/charset/Charset;", "GetDetectedCharsetHandler")]
public virtual Java.Nio.Charset.Charset? DetectedCharset();
[<Android.Runtime.Register("detectedCharset", "()Ljava/nio/charset/Charset;", "GetDetectedCharsetHandler")>]
abstract member DetectedCharset : unit -> Java.Nio.Charset.Charset
override this.DetectedCharset : unit -> Java.Nio.Charset.Charset

返回

此自动检测解码器检测到的字符集,或者 null 尚未确定字符集

属性

例外

如果此解码器未实现自动检测字符集,则为 。

如果读取的字节不足以确定字符集,则为 。

注解

检索此解码器  检测到的字符集; (可选操作) 。

如果此解码器实现自动检测字符集,此方法在检测到字符集后返回实际字符集。 在该点之后,此方法在当前解码操作的持续时间内返回相同的值。 如果尚未读取足够的输入字节来确定实际的字符集,则此方法将引发一个 IllegalStateException。

此方法的默认实现始终引发 ; UnsupportedOperationException应通过自动检测解码器重写它以返回相应的值。

Java文档java.nio.charset.CharsetDecoder.detectedCharset()。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于