共用方式為


Files.NewBufferedReader Method

Definition

Overloads

NewBufferedReader(IPath)

Opens a file for reading, returning a BufferedReader to read text from the file in an efficient manner.

NewBufferedReader(IPath, Charset)

Opens a file for reading, returning a BufferedReader that may be used to read text from the file in an efficient manner.

NewBufferedReader(IPath)

Opens a file for reading, returning a BufferedReader to read text from the file in an efficient manner.

[Android.Runtime.Register("newBufferedReader", "(Ljava/nio/file/Path;)Ljava/io/BufferedReader;", "", ApiSince=26)]
public static Java.IO.BufferedReader? NewBufferedReader (Java.Nio.FileNio.IPath? path);
[<Android.Runtime.Register("newBufferedReader", "(Ljava/nio/file/Path;)Ljava/io/BufferedReader;", "", ApiSince=26)>]
static member NewBufferedReader : Java.Nio.FileNio.IPath -> Java.IO.BufferedReader

Parameters

path
IPath

the path to the file

Returns

a new buffered reader, with default buffer size, to read text from the file

Attributes

Remarks

Opens a file for reading, returning a BufferedReader to read text from the file in an efficient manner. Bytes from the file are decoded into characters using the StandardCharsets#UTF_8 UTF-8Charset charset.

This method works as if invoking it were equivalent to evaluating the expression:

{@code
            Files.newBufferedReader(path, StandardCharsets.UTF_8)
            }

Added in 1.8.

Java documentation for java.nio.file.Files.newBufferedReader(java.nio.file.Path).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

NewBufferedReader(IPath, Charset)

Opens a file for reading, returning a BufferedReader that may be used to read text from the file in an efficient manner.

[Android.Runtime.Register("newBufferedReader", "(Ljava/nio/file/Path;Ljava/nio/charset/Charset;)Ljava/io/BufferedReader;", "", ApiSince=26)]
public static Java.IO.BufferedReader? NewBufferedReader (Java.Nio.FileNio.IPath? path, Java.Nio.Charset.Charset? cs);
[<Android.Runtime.Register("newBufferedReader", "(Ljava/nio/file/Path;Ljava/nio/charset/Charset;)Ljava/io/BufferedReader;", "", ApiSince=26)>]
static member NewBufferedReader : Java.Nio.FileNio.IPath * Java.Nio.Charset.Charset -> Java.IO.BufferedReader

Parameters

path
IPath

the path to the file

cs
Charset

the charset to use for decoding

Returns

a new buffered reader, with default buffer size, to read text from the file

Attributes

Remarks

Opens a file for reading, returning a BufferedReader that may be used to read text from the file in an efficient manner. Bytes from the file are decoded into characters using the specified charset. Reading commences at the beginning of the file.

The Reader methods that read from the file throw IOException if a malformed or unmappable byte sequence is read.

Java documentation for java.nio.file.Files.newBufferedReader(java.nio.file.Path, java.nio.charset.Charset).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to