Android Utililty Methods ByteBuffer to Long Convert

List of utility methods to do ByteBuffer to Long Convert

Description

The list of methods to do ByteBuffer to Long Convert are organized into topic(s).

Method

longreadLong(ByteBuffer in, final int fitInBytes)
Read long which was written to fitInBytes bytes and increment position.
long tmpLength = 0;
for (int i = 0; i < fitInBytes; ++i) {
    tmpLength |= (in.get() & 0xffl) << (8l * i);
return tmpLength;
voidwriteVLong(ByteBuffer out, long i)
Similar to WritableUtils#writeVLong(java.io.DataOutput,long) , but writes to a ByteBuffer .
if (i >= -112 && i <= 127) {
    out.put((byte) i);
    return;
int len = -112;
if (i < 0) {
    i ^= -1L; 
    len = -120;
...