public static long toLong(ByteBuffer buf,int offset){
  if (littleEndian) {
    return Long.reverseBytes(getAsLong(buf,offset));
  }
  return getAsLong(buf,offset);
}

public static long toLong ( ByteBuffer buf , int offset ) { if ( littleEndian ) { return Long . reverseBytes ( getAsLong ( buf , offset ) ) ; } return getAsLong ( buf , offset ) ; }
reads a long value at the given buffer ' s offset considering it was written in big - endian format .
