Uses of Class
java.nio.charset.Charset
Packages that use Charset
Package
Description
Provides a simple high-level Http server API, which can be used to build
embedded HTTP servers.
Provides for system input and output through data streams,
serialization and the file system.
Provides classes that are fundamental to the design of the Java
programming language.
Provides the classes for implementing networking applications.
HTTP Client and WebSocket APIs
Defines channels, which represent connections to entities that are capable of
performing I/O operations, such as files and sockets; defines selectors, for
multiplexed, non-blocking I/O operations.
Defines charsets, decoders, and encoders, for translating between
bytes and Unicode characters.
Service-provider classes for the
java.nio.charset package.Defines interfaces and classes for the Java virtual machine to access files,
file attributes, and file systems.
Contains the collections framework, some internationalization support classes,
a service loader, properties, random number generation, string parsing
and scanning classes, base64 encoding and decoding, a bit array, and
several miscellaneous utility classes.
Provides classes for reading and writing the standard ZIP and GZIP file
formats.
Provides interfaces for tools which can be invoked from a program,
for example, compilers.
-
Uses of Charset in com.sun.net.httpserver
Constructors in com.sun.net.httpserver with parameters of type CharsetModifierConstructorDescriptionBasicAuthenticator(String realm, Charset charset) Creates aBasicAuthenticatorfor the given HTTP realm and using the givenCharsetto decode the Basic authentication credentials (username and password). -
Uses of Charset in java.io
Modifier and TypeMethodDescriptionConsole.charset()Returns theCharsetobject used for theConsole.Modifier and TypeMethodDescriptionConverts the buffer's contents into a string by decoding the bytes using the specifiedcharset.ModifierConstructorDescriptionFileReader(File file, Charset charset) FileReader(String fileName, Charset charset) Creates a newFileReader, given the name of the file to read and the charset.FileWriter(File file, Charset charset) FileWriter(File file, Charset charset, boolean append) Constructs aFileWritergiven theFileto write, charset and a boolean indicating whether to append the data written.FileWriter(String fileName, Charset charset) Constructs aFileWritergiven a file name and charset.FileWriter(String fileName, Charset charset, boolean append) Constructs aFileWritergiven a file name, charset and a boolean indicating whether to append the data written.InputStreamReader(InputStream in, Charset cs) Creates an InputStreamReader that uses the given charset.OutputStreamWriter(OutputStream out, Charset cs) Creates an OutputStreamWriter that uses the given charset.PrintStream(File file, Charset charset) Creates a new print stream, without automatic line flushing, with the specified file and charset.PrintStream(OutputStream out, boolean autoFlush, Charset charset) Creates a new print stream, with the specified OutputStream, line flushing and charset.PrintStream(String fileName, Charset charset) Creates a new print stream, without automatic line flushing, with the specified file name and charset.PrintWriter(File file, Charset charset) Creates a new PrintWriter, without automatic line flushing, with the specified file and charset.PrintWriter(OutputStream out, boolean autoFlush, Charset charset) Creates a new PrintWriter from an existing OutputStream.PrintWriter(String fileName, Charset charset) Creates a new PrintWriter, without automatic line flushing, with the specified file name and charset. -
Uses of Charset in java.lang
Modifier and TypeMethodDescriptionfinal BufferedReaderProcess.errorReader(Charset charset) Returns aBufferedReaderconnected to the standard error of this process using a Charset.byte[]Encodes thisStringinto a sequence of bytes using the given charset, storing the result into a new byte array.final BufferedReaderProcess.inputReader(Charset charset) Returns aBufferedReaderconnected to the standard output of this process using a Charset.final BufferedWriterProcess.outputWriter(Charset charset) Returns aBufferedWriterconnected to the normal input of the process using a Charset. -
Uses of Charset in java.net
-
Uses of Charset in java.net.http
Methods in java.net.http with parameters of type CharsetModifier and TypeMethodDescriptionstatic <S extends Flow.Subscriber<? super String>,T>
HttpResponse.BodySubscriber<T>HttpResponse.BodySubscribers.fromLineSubscriber(S subscriber, Function<? super S, ? extends T> finisher, Charset charset, String lineSeparator) Returns a body subscriber that forwards all response body to the givenFlow.Subscriber, line by line.static HttpResponse.BodySubscriber<Stream<String>>Returns aBodySubscriberwhich streams the response body as aStream<String>, where each string in the stream corresponds to a line as defined byBufferedReader.lines().static HttpRequest.BodyPublisherReturns a request body publisher whose body is the givenString, converted using the given character set.static HttpResponse.BodyHandler<String>Returns aBodyHandler<String>that returns aBodySubscriber<String>obtained fromBodySubscribers.ofString(Charset).static HttpResponse.BodySubscriber<String>Returns a body subscriber which stores the response body as aStringconverted using the givenCharset. -
Uses of Charset in java.nio.channels
Methods in java.nio.channels with parameters of type CharsetModifier and TypeMethodDescriptionstatic ReaderChannels.newReader(ReadableByteChannel ch, Charset charset) Constructs a reader that decodes bytes from the given channel according to the given charset.static WriterChannels.newWriter(WritableByteChannel ch, Charset charset) Constructs a writer that encodes characters according to the given charset and writes the resulting bytes to the given channel. -
Uses of Charset in java.nio.charset
Fields in java.nio.charset declared as CharsetModifier and TypeFieldDescriptionstatic final CharsetStandardCharsets.ISO_8859_1ISO Latin Alphabet No. 1, also known as ISO-LATIN-1.static final CharsetStandardCharsets.US_ASCIISeven-bit ASCII, also known as ISO646-US, also known as the Basic Latin block of the Unicode character set.static final CharsetStandardCharsets.UTF_16Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark.static final CharsetStandardCharsets.UTF_16BESixteen-bit UCS Transformation Format, big-endian byte order.static final CharsetStandardCharsets.UTF_16LESixteen-bit UCS Transformation Format, little-endian byte order.static final CharsetStandardCharsets.UTF_8Eight-bit UCS Transformation Format.Methods in java.nio.charset that return CharsetModifier and TypeMethodDescriptionfinal CharsetCharsetDecoder.charset()Returns the charset that created this decoder.final CharsetCharsetEncoder.charset()Returns the charset that created this encoder.static CharsetCharset.defaultCharset()Returns the default charset of this Java virtual machine.CharsetDecoder.detectedCharset()Retrieves the charset that was detected by this decoder (optional operation).static CharsetReturns a charset object for the named charset.Methods in java.nio.charset that return types with arguments of type CharsetModifier and TypeMethodDescriptionCharset.availableCharsets()Constructs a sorted map from canonical charset names to charset objects.Methods in java.nio.charset with parameters of type CharsetModifier and TypeMethodDescriptionfinal intCompares this charset to another.abstract booleanTells whether or not this charset contains the given charset.Constructors in java.nio.charset with parameters of type CharsetModifierConstructorDescriptionprotectedCharsetDecoder(Charset cs, float averageCharsPerByte, float maxCharsPerByte) Initializes a new decoder.protectedCharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar) Initializes a new encoder.protectedCharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement) Initializes a new encoder. -
Uses of Charset in java.nio.charset.spi
Methods in java.nio.charset.spi that return CharsetModifier and TypeMethodDescriptionabstract CharsetCharsetProvider.charsetForName(String charsetName) Retrieves a charset for the given charset name.Methods in java.nio.charset.spi that return types with arguments of type Charset -
Uses of Charset in java.nio.file
Methods in java.nio.file with parameters of type CharsetModifier and TypeMethodDescriptionRead all lines from a file as aStream.static BufferedReaderFiles.newBufferedReader(Path path, Charset cs) Opens a file for reading, returning aBufferedReaderthat may be used to read text from the file in an efficient manner.static BufferedWriterFiles.newBufferedWriter(Path path, Charset cs, OpenOption... options) Opens or creates a file for writing, returning aBufferedWriterthat may be used to write text to the file in an efficient manner.Files.readAllLines(Path path, Charset cs) Read all lines from a file.static StringFiles.readString(Path path, Charset cs) Reads all characters from a file into a string, decoding from bytes to characters using the specified charset.static PathFiles.write(Path path, Iterable<? extends CharSequence> lines, Charset cs, OpenOption... options) Write lines of text to a file.static PathFiles.writeString(Path path, CharSequence csq, Charset cs, OpenOption... options) Write a CharSequence to a file. -
Uses of Charset in java.util
Modifier and TypeMethodDescriptionvoidProperties.storeToXML(OutputStream os, String comment, Charset charset) Emits an XML document representing all of the properties contained in this table, using the specified encoding.ModifierConstructorDescriptionConstructs a new formatter with the specified file, charset, and locale.Formatter(OutputStream os, Charset charset, Locale l) Constructs a new formatter with the specified output stream, charset, and locale.Constructs a new formatter with the specified file name, charset, and locale.Constructs a newScannerthat produces values scanned from the specified file.Scanner(InputStream source, Charset charset) Constructs a newScannerthat produces values scanned from the specified input stream.Scanner(ReadableByteChannel source, Charset charset) Constructs a newScannerthat produces values scanned from the specified channel.Constructs a newScannerthat produces values scanned from the specified file. -
Uses of Charset in java.util.zip
Constructors in java.util.zip with parameters of type CharsetModifierConstructorDescriptionOpens a newZipFileto read from the specifiedFileobject in the specified mode.Opens a ZIP file for reading given the specified File object.Opens a zip file for reading.ZipInputStream(InputStream in, Charset charset) Creates a new ZIP input stream.ZipOutputStream(OutputStream out, Charset charset) Creates a new ZIP output stream. -
Uses of Charset in javax.tools
Methods in javax.tools with parameters of type CharsetModifier and TypeMethodDescriptionDocumentationTool.getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset) Returns a new instance of the standard file manager implementation for this tool.JavaCompiler.getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset) Returns a new instance of the standard file manager implementation for this tool.