Sdílet prostřednictvím


Reader.Read Method

Definition

Overloads

Read(Char[], Int32, Int32)

Reads characters into a portion of an array.

Read(Char[])

Reads characters into an array.

Read()

Reads a single character.

Read(CharBuffer)

Attempts to read characters into the specified character buffer.

Read(Char[], Int32, Int32)

Reads characters into a portion of an array.

[Android.Runtime.Register("read", "([CII)I", "GetRead_arrayCIIHandler")]
public abstract int Read (char[]? cbuf, int off, int len);
[<Android.Runtime.Register("read", "([CII)I", "GetRead_arrayCIIHandler")>]
abstract member Read : char[] * int * int -> int

Parameters

cbuf
Char[]

Destination buffer

off
Int32

Offset at which to start storing characters

len
Int32

Maximum number of characters to read

Returns

The number of characters read, or -1 if the end of the stream has been reached

Attributes

Exceptions

if this reader is closed or some other I/O error occurs.

Remarks

Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

Java documentation for java.io.Reader.read(char[], int, int).

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

Read(Char[])

Reads characters into an array.

[Android.Runtime.Register("read", "([C)I", "GetRead_arrayCHandler")]
public virtual int Read (char[]? cbuf);
[<Android.Runtime.Register("read", "([C)I", "GetRead_arrayCHandler")>]
abstract member Read : char[] -> int
override this.Read : char[] -> int

Parameters

cbuf
Char[]

Destination buffer

Returns

The number of characters read, or -1 if the end of the stream has been reached

Attributes

Exceptions

if this reader is closed or some other I/O error occurs.

Remarks

Reads characters into an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

Java documentation for java.io.Reader.read(char[]).

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

Read()

Reads a single character.

[Android.Runtime.Register("read", "()I", "GetReadHandler")]
public virtual int Read ();
[<Android.Runtime.Register("read", "()I", "GetReadHandler")>]
abstract member Read : unit -> int
override this.Read : unit -> int

Returns

The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached

Attributes

Exceptions

if this reader is closed or some other I/O error occurs.

Remarks

Reads a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.

Subclasses that intend to support efficient single-character input should override this method.

Java documentation for java.io.Reader.read().

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

Read(CharBuffer)

Attempts to read characters into the specified character buffer.

[Android.Runtime.Register("read", "(Ljava/nio/CharBuffer;)I", "GetRead_Ljava_nio_CharBuffer_Handler")]
public virtual int Read (Java.Nio.CharBuffer? target);
[<Android.Runtime.Register("read", "(Ljava/nio/CharBuffer;)I", "GetRead_Ljava_nio_CharBuffer_Handler")>]
abstract member Read : Java.Nio.CharBuffer -> int
override this.Read : Java.Nio.CharBuffer -> int

Parameters

target
CharBuffer

the buffer to read characters into

Returns

The number of characters added to the buffer, or -1 if this source of characters is at its end

Implements

Attributes

Exceptions

if any I/O error occurs while reading from this reader.

if target is null.

if target is read-only.

Remarks

Attempts to read characters into the specified character buffer. The buffer is used as a repository of characters as-is: the only changes made are the results of a put operation. No flipping or rewinding of the buffer is performed.

Added in 1.5.

Java documentation for java.io.Reader.read(java.nio.CharBuffer).

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