code: static long checkPreambleSize(final Memory mem) {
      final long cap = mem.getCapacity();
      if (cap < 8) { throwNotBigEnough(cap, 8); }
      final long pre0 = mem.getLong(0);
      final int preLongs = (int) (pre0 & 0X3FL); //lower 6 bits
      final int required = Math.max(preLongs << 3, 8);
      if (cap < required) { throwNotBigEnough(cap, required); }
      return pre0;
    }
docs: Checks Memory for capacity to hold the preamble and returns the first 8 bytes.
  @param mem the given Memory
  @return the first 8 bytes of preamble as a long.