Java Utililty Methods InputStream Read Long

List of utility methods to do InputStream Read Long

Description

The list of methods to do InputStream Read Long are organized into topic(s).

Method

longreadLong(InputStream in)
read Long
byte[] buffer = new byte[8];
readFully(in, buffer, 0, 8);
return (((long) buffer[0] << 56) + ((long) (buffer[1] & 255) << 48) + ((long) (buffer[2] & 255) << 40)
        + ((long) (buffer[3] & 255) << 32) + ((long) (buffer[4] & 255) << 24) + ((buffer[5] & 255) << 16)
        + ((buffer[6] & 255) << 8) + ((buffer[7] & 255) << 0));
longreadLong(InputStream input)
Read long, little endian.
int n = 0;
byte[] readBuffer = new byte[8];
while (n < 8) {
    int count = input.read(readBuffer, n, 8 - n);
    if (count < 0)
        throw new EOFException();
    n += count;
return ((long) readBuffer[7] << 56) + ((long) (readBuffer[6] & 255) << 48)
        + ((long) (readBuffer[5] & 255) << 40) + ((long) (readBuffer[4] & 255) << 32)
        + ((long) (readBuffer[3] & 255) << 24) + ((readBuffer[2] & 255) << 16)
        + ((readBuffer[1] & 255) << 8) + ((readBuffer[0] & 255));
longreadLong(InputStream inputStream)
read Long
long value = 0L;
int i = 0;
long b;
while (((b = inputStream.read()) & 0x80L) != 0) {
    value |= (b & 0x7F) << i;
    i += 7;
    if (i >= 7 * 10) {
        throw new IOException("Didn't reach the end of the long varint after 10 bytes.");
...
longreadLong(InputStream inputStream)
Read in a long from an InputStream
byte[] byteArray = new byte[8];
inputStream.read(byteArray);
long number = convertLongFromBytes(byteArray);
return number;
longreadLong(InputStream is)
read Long
byte[] bytes = new byte[8];
is.read(bytes);
return getLong(bytes);
longreadLong(InputStream is)
read Long
byte[] b = new byte[8];
read(is, b);
return toLong(b);
longreadLong(InputStream is)
read Long
long d0 = is.read();
long d1 = is.read();
long d2 = is.read();
long d3 = is.read();
long d4 = is.read();
long d5 = is.read();
long d6 = is.read();
long d7 = is.read();
...
longreadLong(InputStream is)
read Long
byte[] buf = new byte[8];
readFully(is, buf);
return (((buf[7] & 0xffL) << 56) | ((buf[6] & 0xffL) << 48) | ((buf[5] & 0xffL) << 40)
        | ((buf[4] & 0xffL) << 32) | ((buf[3] & 0xffL) << 24) | ((buf[2] & 0xffL) << 16)
        | ((buf[1] & 0xffL) << 8) | (buf[0] & 0xffL));
longreadLong(InputStream is)
read Long
return (((long) is.read() << 56) + ((long) is.read() << 48) + ((long) is.read() << 40)
        + ((long) is.read() << 32) + ((long) is.read() << 24) + ((long) is.read() << 16)
        + ((long) is.read() << 8) + ((long) is.read()));
longreadLong(InputStream is)
read Long
long n = 0;
n |= ((read(is) & 0xFFL) << 0);
n |= ((read(is) & 0xFFL) << 8);
n |= ((read(is) & 0xFFL) << 16);
n |= ((read(is) & 0xFFL) << 24);
n |= ((read(is) & 0xFFL) << 32);
n |= ((read(is) & 0xFFL) << 40);
n |= ((read(is) & 0xFFL) << 48);
...