Java Utililty Methods DataInput Read Long

List of utility methods to do DataInput Read Long

Description

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

Method

longreadLong(DataInput dataInput)
read Long
byte[] bytes = new byte[8];
dataInput.readFully(bytes);
return (((long) bytes[7] << 56) + ((long) (bytes[6] & 255) << 48) + ((long) (bytes[5] & 255) << 40)
        + ((long) (bytes[4] & 255) << 32) + ((long) (bytes[3] & 255) << 24) + ((bytes[2] & 255) << 16)
        + ((bytes[1] & 255) << 8) + ((bytes[0] & 255) << 0));
LongreadLong(DataInput in)
Reads a Long value.
if (readNullFlag(in))
    return null;
return new Long(in.readLong());
longreadLong(DataInput in)
read Long
byte len = in.readByte();
if (len == 0)
    return 0;
byte[] buf = new byte[len];
in.readFully(buf, 0, len);
return makeLong(buf, 0, len);
long[]readLongSequence(DataInput in)
read Long Sequence
byte len = in.readByte();
if (len == 0)
    return new long[] { 0, 0 };
byte[] lengths = decodeLength(len);
long[] seqnos = new long[2];
byte[] buf = new byte[lengths[0] + lengths[1]];
in.readFully(buf, 0, buf.length);
seqnos[0] = makeLong(buf, 0, lengths[0]);
...
StringreadLongUTF8(DataInput in)
Read a UTF8 String previously written with writeLongUTF8.
int len = in.readInt();
if (len == 0)
    return "";
char[] cbuf = new char[len];
for (int i = 0; i < len; i++) {
    int b1, b2, b3;
    b1 = in.readUnsignedByte();
    switch (b1 >> 4) {
...