public void toData(DataOutput out, boolean includeMember) throws IOException {
    int flags = 0;
    boolean versionIsShort = false;
    if (entryVersion < 0x10000) {
      versionIsShort = true;
      flags |= VERSION_TWO_BYTES;
    }
    if (regionVersionHighBytes != 0) {
      flags |= HAS_RVV_HIGH_BYTE;
    }
    if (memberID != null && includeMember) {
      flags |= HAS_MEMBER_ID;
    }
    boolean writePreviousMemberID = false;
    if (previousMemberID != null && includeMember) {
      flags |= HAS_PREVIOUS_MEMBER_ID;
      if (Objects.equals(previousMemberID, memberID)) {
        flags |= DUPLICATE_MEMBER_IDS;
      } else {
        writePreviousMemberID = true;
      }
    }
    if (logger.isTraceEnabled(LogMarker.VERSION_TAG_VERBOSE)) {
      logger.trace(LogMarker.VERSION_TAG_VERBOSE, "serializing {} with flags 0x{}", getClass(),
          Integer.toHexString(flags));
    }
    out.writeShort(flags);
    out.writeShort(bits);
    out.write(distributedSystemId);
    if (versionIsShort) {
      out.writeShort(entryVersion & 0xffff);
    } else {
      out.writeInt(entryVersion);
    }
    if (regionVersionHighBytes != 0) {
      out.writeShort(regionVersionHighBytes);
    }
    out.writeInt(regionVersionLowBytes);
    InternalDataSerializer.writeUnsignedVL(timeStamp, out);
    if (memberID != null && includeMember) {
      writeMember(memberID, out);
    }
    if (writePreviousMemberID) {
      writeMember(previousMemberID, out);
    }
  }
returns true if entry and region version numbers are not both zero, meaning this has valid
version numbers
geode-core/src/main/java/org/apache/geode/internal/cache/versions/VersionTag.java