src/share/classes/java/nio/file/Path.java
Print this page
rev 3975 : 4884238: Adds java.nio.charset.StandardCharset to provide static final constants for the standard charsets.
@@ -70,11 +70,11 @@
* java.io.BufferedReader} to read text from a file "{@code access.log}". The
* file is located in a directory "{@code logs}" relative to the current working
* directory and is UTF-8 encoded.
* <pre>
* Path path = FileSystems.getDefault().getPath("logs", "access.log");
- * BufferReader reader = Files.newBufferedReader(path, Charset.forName("UTF-8"));
+ * BufferReader reader = Files.newBufferedReader(path, StandardCharset.UTF_8);
* </pre>
*
* <a name="interop"><h4>Interoperability</h4></a>
* <p> Paths associated with the default {@link
* java.nio.file.spi.FileSystemProvider provider} are generally interoperable