Java.Nio.Channels.FileChannel.Read Method
Reads bytes from this file channel into the given buffer starting from the specified file position.

Syntax

[Android.Runtime.Register("read", "(Ljava/nio/ByteBuffer;J)I", "GetRead_Ljava_nio_ByteBuffer_JHandler")]
public abstract int Read (Java.Nio.ByteBuffer buffer, long position)

Parameters

buffer
the buffer to receive the bytes.
position
the (non-negative) position at which to read the bytes.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.Nio.Channels.AsynchronousCloseExceptionif this channel is closed by another thread while this method is executing.
Java.Nio.Channels.ClosedByInterruptExceptionif another thread interrupts the calling thread while this operation is in progress. The calling thread will have the interrupt state set, and the channel will be closed.
Java.Nio.Channels.ClosedChannelExceptionif this channel is closed.
Java.Lang.IllegalArgumentExceptionif position is less than 0.
Java.IO.IOExceptionif another I/O error occurs.
Java.Nio.Channels.NonReadableChannelExceptionif the channel has not been opened in a mode that permits reading.

Remarks

Reads bytes from this file channel into the given buffer starting from the specified file position.

The bytes are read starting at the given file position (up to the remaining number of bytes in the buffer). The number of bytes actually read is returned.

If position is beyond the current end of file, then no bytes are read.

Note that the file position is unmodified by this method.

[Android Documentation]

Requirements

Namespace: Java.Nio.Channels
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1