## Uses of Class
java.nio.charset.Charset

- Packages that use Charset
  Package | Description
  --- | ---
  java.io |
  java.nio.charset |

- - ### Uses of Charset in java.io

    Constructors in java.io with parameters of type Charset
    Constructor and Description
    `OutputStreamWriter(OutputStream out, Charset cs)` Creates an OutputStreamWriter that uses the given charset.

  - ### Uses of Charset in java.nio.charset

    Methods in java.nio.charset that return Charset
    Modifier and Type | Method and Description
    --- | ---
    `Charset` | CharsetEncoder.`charset()` Returns the charset that created this encoder.
    `Charset` | CharsetDecoder.`charset()` Returns the charset that created this decoder.
    `static Charset` | Charset.`defaultCharset()` Returns the default charset of this Java virtual machine.
    `Charset` | CharsetDecoder.`detectedCharset()` Retrieves the charset that was detected by this decoder (optional operation).
    `static Charset` | Charset.`forName(String charsetName)` Returns a charset object for the named charset.

    Methods in java.nio.charset that return types with arguments of type Charset
    Modifier and Type | Method and Description
    --- | ---
    `static SortedMap<String,Charset>` | Charset.`availableCharsets()` Constructs a sorted map from canonical charset names to charset objects.

    Methods in java.nio.charset with parameters of type Charset
    Modifier and Type | Method and Description
    --- | ---
    `int` | Charset.`compareTo(Charset that)` Compares this charset to another.
    `abstract boolean` | Charset.`contains(Charset cs)` Tells whether or not this charset contains the given charset.

    Constructors in java.nio.charset with parameters of type Charset
    Constructor and Description
    `CharsetDecoder(Charset cs, float averageCharsPerByte, float maxCharsPerByte)` Initializes a new decoder.
    `CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar)` Initializes a new encoder.
    `CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement)` Initializes a new encoder.

Copyright © 2025 API Design. All Rights Reserved.