private byte[] encode(Address fromAddr, Address toAddr, RefType type, SourceType source,
			int opIndex, long symbolID, boolean isPrimary, boolean isOffsetRef, boolean isShiftRef,
			long offsetOrShift) {
		int length = BASE_REF_SIZE;
		boolean hasSymbolID = symbolID >= 0;
		if (isOffsetRef || isShiftRef) {
			length += OFFSET_SIZE;
		}
		if (hasSymbolID) {
			length += SYMBOL_ID_SIZE;
		}
		RefListFlagsV0 flags =
			new RefListFlagsV0(isPrimary, isOffsetRef, hasSymbolID, isShiftRef, source);

		byte[] data = new byte[length];
		Address addr = isFrom ? toAddr : fromAddr;
		int offset = putLong(data, 0, addrMap.getKey(addr, true));
		data[offset++] = flags.getValue();
		data[offset++] = type.getValue();
		data[offset++] = (byte) opIndex;
		if (hasSymbolID) {
			offset = putLong(data, offset, symbolID);
		}
		if (isOffsetRef || isShiftRef) {
			offset = putLong(data, offset, offsetOrShift);
		}
		return data;
	}
Construct reference list for existing record
@param rec existing refList record
@param adapter entry record storage adapter
@param addrMap address map for encoding/decoding addresses
@param program may be null for upgrade in which 
		case resulting reference objects are not suitable for general use.
@param cache RefList object cache
@param isFrom true for from-adapter use, false for to-adapter use
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/references/RefListV0.java