@Override
	public int getBytes(byte[] b, int offset) {
		if (program == null) {
			// program not specified - allow partial fill 
			if (offset < 0 || offset >= bytes.length) {
				return 0;
			}
			int len = Math.min(b.length, bytes.length - offset);
			synchronized (this) {
				refreshIfNeeded();
				System.arraycopy(bytes, offset, b, 0, b.length);
			}
			return len;
		}

		// program specified - go for complete fill
		if (offset < 0 || (offset + b.length) > bytes.length) {
			try {
				return program.getMemory().getBytes(address.add(offset), b);
			}
			catch (AddressOutOfBoundsException | MemoryAccessException e) {
				return 0;
			}
		}

		synchronized (this) {
			refreshIfNeeded();
			System.arraycopy(bytes, offset, b, 0, b.length);
			return b.length;
		}
	}
Gets the bytes for this code unit.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/util/PseudoCodeUnit.java