code: public final int compare(MemorySegment seg2, int offset1, int offset2, int len) {
  		while (len >= 8) {
  			long l1 = this.getLongBigEndian(offset1);
  			long l2 = seg2.getLongBigEndian(offset2);
  
  			if (l1 != l2) {
  				return (l1 < l2) ^ (l1 < 0) ^ (l2 < 0) ? -1 : 1;
  			}
  
  			offset1 += 8;
  			offset2 += 8;
  			len -= 8;
  		}
  		while (len > 0) {
  			int b1 = this.get(offset1) & 0xff;
  			int b2 = seg2.get(offset2) & 0xff;
  			int cmp = b1 - b2;
  			if (cmp != 0) {
  				return cmp;
  			}
  			offset1++;
  			offset2++;
  			len--;
  		}
  		return 0;
  	}
docs: Compares two memory segment regions.
  
  @param seg2 Segment to compare this segment with
  @param offset1 Offset of this segment to start comparing
  @param offset2 Offset of seg2 to start comparing
  @param len Length of the compared memory region
  
  @return 0 if equal, -1 if seg1 &lt; seg2, 1 otherwise