Compartilhar via


Scanner Constructors

Definition

Overloads

Scanner(File)

Constructs a new Scanner that produces values scanned from the specified file.

Scanner(IReadable)

Constructs a new Scanner that produces values scanned from the specified source.

Scanner(IReadableByteChannel)

Constructs a new Scanner that produces values scanned from the specified channel.

Scanner(IPath)

Constructs a new Scanner that produces values scanned from the specified file.

Scanner(Stream)

Constructs a new Scanner that produces values scanned from the specified input stream.

Scanner(String)

Constructs a new Scanner that produces values scanned from the specified string.

Scanner(File, Charset)
Scanner(File, String)

Constructs a new Scanner that produces values scanned from the specified file.

Scanner(IReadableByteChannel, Charset)
Scanner(IReadableByteChannel, String)

Constructs a new Scanner that produces values scanned from the specified channel.

Scanner(IPath, Charset)
Scanner(IPath, String)

Constructs a new Scanner that produces values scanned from the specified file.

Scanner(Stream, Charset)
Scanner(Stream, String)

Constructs a new Scanner that produces values scanned from the specified input stream.

Scanner(File)

Constructs a new Scanner that produces values scanned from the specified file.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;)V", "")]
public Scanner (Java.IO.File? source);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;)V", "")>]
new Java.Util.Scanner : Java.IO.File -> Java.Util.Scanner

Parameters

source
File

A file to be scanned

Attributes

Exceptions

if the specified file does not exist.

Remarks

Java documentation for java.util.Scanner.Scanner(java.io.File).

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

Scanner(IReadable)

Constructs a new Scanner that produces values scanned from the specified source.

[Android.Runtime.Register(".ctor", "(Ljava/lang/Readable;)V", "")]
public Scanner (Java.Lang.IReadable? source);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/Readable;)V", "")>]
new Java.Util.Scanner : Java.Lang.IReadable -> Java.Util.Scanner

Parameters

source
IReadable

A character source implementing the Readable interface

Attributes

Remarks

Java documentation for java.util.Scanner.Scanner(java.lang.Readable).

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

Scanner(IReadableByteChannel)

Constructs a new Scanner that produces values scanned from the specified channel.

[Android.Runtime.Register(".ctor", "(Ljava/nio/channels/ReadableByteChannel;)V", "")]
public Scanner (Java.Nio.Channels.IReadableByteChannel? source);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/channels/ReadableByteChannel;)V", "")>]
new Java.Util.Scanner : Java.Nio.Channels.IReadableByteChannel -> Java.Util.Scanner

Parameters

source
IReadableByteChannel

A channel to scan

Attributes

Remarks

Java documentation for java.util.Scanner.Scanner(java.nio.channels.ReadableByteChannel).

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

Scanner(IPath)

Constructs a new Scanner that produces values scanned from the specified file.

[Android.Runtime.Register(".ctor", "(Ljava/nio/file/Path;)V", "", ApiSince=26)]
public Scanner (Java.Nio.FileNio.IPath? source);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/file/Path;)V", "", ApiSince=26)>]
new Java.Util.Scanner : Java.Nio.FileNio.IPath -> Java.Util.Scanner

Parameters

source
IPath

the path to the file to be scanned

Attributes

Remarks

Java documentation for java.util.Scanner.Scanner(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

Scanner(Stream)

Constructs a new Scanner that produces values scanned from the specified input stream.

[Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;)V", "")]
public Scanner (System.IO.Stream? source);
[<Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;)V", "")>]
new Java.Util.Scanner : System.IO.Stream -> Java.Util.Scanner

Parameters

source
Stream

An input stream to be scanned

Attributes

Remarks

Java documentation for java.util.Scanner.Scanner(java.io.InputStream).

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

Scanner(String)

Constructs a new Scanner that produces values scanned from the specified string.

[Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")]
public Scanner (string? source);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/String;)V", "")>]
new Java.Util.Scanner : string -> Java.Util.Scanner

Parameters

source
String

A string to scan

Attributes

Remarks

Java documentation for java.util.Scanner.Scanner(java.lang.String).

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

Scanner(File, Charset)

[Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/nio/charset/Charset;)V", "", ApiSince=34)]
public Scanner (Java.IO.File? source, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/nio/charset/Charset;)V", "", ApiSince=34)>]
new Java.Util.Scanner : Java.IO.File * Java.Nio.Charset.Charset -> Java.Util.Scanner

Parameters

source
File
charset
Charset
Attributes

Applies to

Scanner(File, String)

Constructs a new Scanner that produces values scanned from the specified file.

[Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/lang/String;)V", "")]
public Scanner (Java.IO.File? source, string? charsetName);
[<Android.Runtime.Register(".ctor", "(Ljava/io/File;Ljava/lang/String;)V", "")>]
new Java.Util.Scanner : Java.IO.File * string -> Java.Util.Scanner

Parameters

source
File

A file to be scanned

charsetName
String

The encoding type used to convert bytes from the file into characters to be scanned

Attributes

Exceptions

if the specified file does not exist.

if the specified coding does not exist.

Remarks

Java documentation for java.util.Scanner.Scanner(java.io.File, java.lang.String).

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

Scanner(IReadableByteChannel, Charset)

[Android.Runtime.Register(".ctor", "(Ljava/nio/channels/ReadableByteChannel;Ljava/nio/charset/Charset;)V", "", ApiSince=34)]
public Scanner (Java.Nio.Channels.IReadableByteChannel? source, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/channels/ReadableByteChannel;Ljava/nio/charset/Charset;)V", "", ApiSince=34)>]
new Java.Util.Scanner : Java.Nio.Channels.IReadableByteChannel * Java.Nio.Charset.Charset -> Java.Util.Scanner

Parameters

charset
Charset
Attributes

Applies to

Scanner(IReadableByteChannel, String)

Constructs a new Scanner that produces values scanned from the specified channel.

[Android.Runtime.Register(".ctor", "(Ljava/nio/channels/ReadableByteChannel;Ljava/lang/String;)V", "")]
public Scanner (Java.Nio.Channels.IReadableByteChannel? source, string? charsetName);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/channels/ReadableByteChannel;Ljava/lang/String;)V", "")>]
new Java.Util.Scanner : Java.Nio.Channels.IReadableByteChannel * string -> Java.Util.Scanner

Parameters

source
IReadableByteChannel

A channel to scan

charsetName
String

The encoding type used to convert bytes from the channel into characters to be scanned

Attributes

Exceptions

if the specified character set is not found.

Remarks

Java documentation for java.util.Scanner.Scanner(java.nio.channels.ReadableByteChannel, java.lang.String).

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

Scanner(IPath, Charset)

[Android.Runtime.Register(".ctor", "(Ljava/nio/file/Path;Ljava/nio/charset/Charset;)V", "", ApiSince=34)]
public Scanner (Java.Nio.FileNio.IPath? source, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/file/Path;Ljava/nio/charset/Charset;)V", "", ApiSince=34)>]
new Java.Util.Scanner : Java.Nio.FileNio.IPath * Java.Nio.Charset.Charset -> Java.Util.Scanner

Parameters

source
IPath
charset
Charset
Attributes

Applies to

Scanner(IPath, String)

Constructs a new Scanner that produces values scanned from the specified file.

[Android.Runtime.Register(".ctor", "(Ljava/nio/file/Path;Ljava/lang/String;)V", "", ApiSince=26)]
public Scanner (Java.Nio.FileNio.IPath? source, string? charsetName);
[<Android.Runtime.Register(".ctor", "(Ljava/nio/file/Path;Ljava/lang/String;)V", "", ApiSince=26)>]
new Java.Util.Scanner : Java.Nio.FileNio.IPath * string -> Java.Util.Scanner

Parameters

source
IPath

the path to the file to be scanned

charsetName
String

The encoding type used to convert bytes from the file into characters to be scanned

Attributes

Remarks

Java documentation for java.util.Scanner.Scanner(java.nio.file.Path, java.lang.String).

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

Scanner(Stream, Charset)

[Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V", "", ApiSince=34)]
public Scanner (System.IO.Stream? source, Java.Nio.Charset.Charset? charset);
[<Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V", "", ApiSince=34)>]
new Java.Util.Scanner : System.IO.Stream * Java.Nio.Charset.Charset -> Java.Util.Scanner

Parameters

source
Stream
charset
Charset
Attributes

Applies to

Scanner(Stream, String)

Constructs a new Scanner that produces values scanned from the specified input stream.

[Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;Ljava/lang/String;)V", "")]
public Scanner (System.IO.Stream? source, string? charsetName);
[<Android.Runtime.Register(".ctor", "(Ljava/io/InputStream;Ljava/lang/String;)V", "")>]
new Java.Util.Scanner : System.IO.Stream * string -> Java.Util.Scanner

Parameters

source
Stream

An input stream to be scanned

charsetName
String

The encoding type used to convert bytes from the stream into characters to be scanned

Attributes

Exceptions

if the specified character set is not found.

Remarks

Java documentation for java.util.Scanner.Scanner(java.io.InputStream, java.lang.String).

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