public static long readUINT64(InputStream stream) throws IOException {
  long result=0;
  for (int i=0; i <= 56; i+=8) {
    result|=(long)stream.read() << i;
  }
  return result;
}

public static long readUINT64 ( InputStream stream ) throws IOException { long result = 0 ; for ( int i = 0 ; i <= 56 ; i += 8 ) { result |= ( long ) stream . read ( ) << i ; } return result ; }
reads long as little endian .
