Share via


IDataInput.ReadLong Method

Definition

Reads eight input bytes and returns a long value.

[Android.Runtime.Register("readLong", "()J", "GetReadLongHandler:Java.IO.IDataInputInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public long ReadLong ();
[<Android.Runtime.Register("readLong", "()J", "GetReadLongHandler:Java.IO.IDataInputInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member ReadLong : unit -> int64

Returns

the long value read.

Attributes

Exceptions

if the end of the input is reached before the read request can be satisfied.

if an I/O error occurs while reading.

Remarks

Reads eight input bytes and returns a long value. Let a-h be the first through eighth bytes read. The value returned is:

{@code
            (((long)(a & 0xff) << 56) |
             ((long)(b & 0xff) << 48) |
             ((long)(c & 0xff) << 40) |
             ((long)(d & 0xff) << 32) |
             ((long)(e & 0xff) << 24) |
             ((long)(f & 0xff) << 16) |
             ((long)(g & 0xff) <<  8) |
             ((long)(h & 0xff)))
            }

This method is suitable for reading bytes written by the writeLong method of interface DataOutput.

Java documentation for java.io.DataInput.readLong().

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

See also