Stay organized with collections
Save and categorize content based on your preferences.
java.nio.charset
Classes
Charset |
A named mapping between sequences of sixteen-bit Unicode code units and sequences of bytes.
|
CharsetDecoder |
An engine that can transform a sequence of bytes in a specific charset into a sequence of sixteen-bit Unicode characters.
|
CharsetEncoder |
An engine that can transform a sequence of sixteen-bit Unicode characters into a sequence of bytes in a specific charset.
|
CoderResult |
A description of the result state of a coder.
|
CodingErrorAction |
A typesafe enumeration for coding-error actions.
|
StandardCharsets |
Constant definitions for the standard Charsets .
|
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# java.nio.charset\n================\n\nClasses\n-------\n\n|---------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| [Charset](/reference/kotlin/java/nio/charset/Charset) | A named mapping between sequences of sixteen-bit Unicode [code units](../../lang/Character.html#unicode) and sequences of bytes. |\n| [CharsetDecoder](/reference/kotlin/java/nio/charset/CharsetDecoder) | An engine that can transform a sequence of bytes in a specific charset into a sequence of sixteen-bit Unicode characters. |\n| [CharsetEncoder](/reference/kotlin/java/nio/charset/CharsetEncoder) | An engine that can transform a sequence of sixteen-bit Unicode characters into a sequence of bytes in a specific charset. |\n| [CoderResult](/reference/kotlin/java/nio/charset/CoderResult) | A description of the result state of a coder. |\n| [CodingErrorAction](/reference/kotlin/java/nio/charset/CodingErrorAction) | A typesafe enumeration for coding-error actions. |\n| [StandardCharsets](/reference/kotlin/java/nio/charset/StandardCharsets) | Constant definitions for the standard [Charsets](/reference/kotlin/java/nio/charset/Charset). |\n\nExceptions\n----------\n\n|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [CharacterCodingException](/reference/kotlin/java/nio/charset/CharacterCodingException) | Checked exception thrown when a character encoding or decoding error occurs. |\n| [CoderMalfunctionError](/reference/kotlin/java/nio/charset/CoderMalfunctionError) | Error thrown when the [decodeLoop](/reference/kotlin/java/nio/charset/CharsetDecoder#decodeLoop(java.nio.ByteBuffer,%20java.nio.CharBuffer)) method of a [CharsetDecoder](/reference/kotlin/java/nio/charset/CharsetDecoder), or the [encodeLoop](/reference/kotlin/java/nio/charset/CharsetEncoder#encodeLoop(java.nio.CharBuffer,%20java.nio.ByteBuffer)) method of a [CharsetEncoder](/reference/kotlin/java/nio/charset/CharsetEncoder), throws an unexpected exception. |\n| [IllegalCharsetNameException](/reference/kotlin/java/nio/charset/IllegalCharsetNameException) | Unchecked exception thrown when a string that is not a [legal charset name](/reference/kotlin/java/nio/charset/Charset#names) is used as such. |\n| [MalformedInputException](/reference/kotlin/java/nio/charset/MalformedInputException) | Checked exception thrown when an input byte sequence is not legal for given charset, or an input character sequence is not a legal sixteen-bit Unicode sequence. |\n| [UnmappableCharacterException](/reference/kotlin/java/nio/charset/UnmappableCharacterException) | Checked exception thrown when an input character (or byte) sequence is valid but cannot be mapped to an output byte (or character) sequence. |\n| [UnsupportedCharsetException](/reference/kotlin/java/nio/charset/UnsupportedCharsetException) | Unchecked exception thrown when no support is available for a requested charset. |"]]