次の方法で共有


IDataInput.ReadFully Method

Definition

Overloads

ReadFully(Byte[])

Reads some bytes from an input stream and stores them into the buffer array b.

ReadFully(Byte[], Int32, Int32)

Reads len bytes from an input stream.

ReadFully(Byte[])

Reads some bytes from an input stream and stores them into the buffer array b.

[Android.Runtime.Register("readFully", "([B)V", "GetReadFully_arrayBHandler:Java.IO.IDataInputInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void ReadFully (byte[]? b);
[<Android.Runtime.Register("readFully", "([B)V", "GetReadFully_arrayBHandler:Java.IO.IDataInputInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member ReadFully : byte[] -> unit

Parameters

b
Byte[]

the buffer into which the data is read.

Attributes

Exceptions

Remarks

Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b.

This method blocks until one of the following conditions occurs: <ul> <li>b.length bytes of input data are available, in which case a normal return is made.

<li>End of file is detected, in which case an EOFException is thrown.

<li>An I/O error occurs, in which case an IOException other than EOFException is thrown. </ul>

If b is null, a NullPointerException is thrown. If b.length is zero, then no bytes are read. Otherwise, the first byte read is stored into element b[0], the next one into b[1], and so on. If an exception is thrown from this method, then it may be that some but not all bytes of b have been updated with data from the input stream.

Java documentation for java.io.DataInput.readFully(byte[]).

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

ReadFully(Byte[], Int32, Int32)

Reads len bytes from an input stream.

[Android.Runtime.Register("readFully", "([BII)V", "GetReadFully_arrayBIIHandler:Java.IO.IDataInputInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void ReadFully (byte[]? b, int off, int len);
[<Android.Runtime.Register("readFully", "([BII)V", "GetReadFully_arrayBIIHandler:Java.IO.IDataInputInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member ReadFully : byte[] * int * int -> unit

Parameters

b
Byte[]

the buffer into which the data is read.

off
Int32

an int specifying the offset in the data array b.

len
Int32

an int specifying the number of bytes to read.

Attributes

Exceptions

if the end of the source stream is reached before enough bytes have been read.

if offset or byteCount , or offset + byteCount > dst.length.

if a problem occurs while reading from this stream.

if dst is null.

Remarks

Reads len bytes from an input stream.

This method blocks until one of the following conditions occurs: <ul> <li>len bytes of input data are available, in which case a normal return is made.

<li>End of file is detected, in which case an EOFException is thrown.

<li>An I/O error occurs, in which case an IOException other than EOFException is thrown. </ul>

If b is null, a NullPointerException is thrown. If off is negative, or len is negative, or off+len is greater than the length of the array b, then an IndexOutOfBoundsException is thrown. If len is zero, then no bytes are read. Otherwise, the first byte read is stored into element b[off], the next one into b[off+1], and so on. The number of bytes read is, at most, equal to len.

Java documentation for java.io.DataInput.readFully(byte[], 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