DataInputStream.readLong

DataInputStream.readLong

Class Overview | Class Members | This Package | All Packages

Syntax
public final long readLong() throws IOException
Returns
the next eight bytes of this input stream, interpreted as a long.
Description
Reads a signed 64-bit integer from this data input stream. This method reads eight bytes from the underlying input stream. If the bytes read, in order, are b1, b2, b3, b4, b5, b6, b7, and b8, where

then the result is equal to:

     ((long)b1 << 56) + ((long)b2 << 48) +
        ((long)b3 << 40) + ((long)b4 << 32) +
        ((long)b5 << 24) + (b6 << 16) +
        (b7 << 8) + b8
 

This method blocks until the eight bytes are read, the end of the stream is detected, or an exception is thrown.

Exceptions
EOFException if this input stream reaches the end before reading eight bytes.
Exceptions
IOException if an I/O error occurs.
See Also
in