RandomAccessFile.ReadLong Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Reads a signed 64-bit integer from this file.
[Android.Runtime.Register("readLong", "()J", "")]
public long ReadLong ();
[<Android.Runtime.Register("readLong", "()J", "")>]
abstract member ReadLong : unit -> int64
override this.ReadLong : unit -> int64
Returns
the next eight bytes of this file, interpreted as a
long
.
Implements
- Attributes
Exceptions
if the end of this file is detected.
if this file is closed or another I/O error occurs.
Remarks
Reads a signed 64-bit integer from this file. This method reads eight bytes from the file, starting at the current file pointer. If the bytes read, in order, are b1
, b2
, b3
, b4
, b5
, b6
, b7
, and b8,
where: <blockquote>
0 <= b1, b2, b3, b4, b5, b6, b7, b8 <=255,
</blockquote>
then the result is equal to: <blockquote>
((long)b1 << 56) + ((long)b2 << 48)
+ ((long)b3 << 40) + ((long)b4 << 32)
+ ((long)b5 << 24) + ((long)b6 << 16)
+ ((long)b7 << 8) + b8
</blockquote>
This method blocks until the eight bytes are read, the end of the stream is detected, or an exception is thrown.
Java documentation for java.io.RandomAccessFile.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.