public static byte[] getBytes(Memory memory, Address startAddress, int length)
			throws InvalidDataTypeException {
		byte[] bytes = new byte[length];
		try {
			int bytesRead = memory.getBytes(startAddress, bytes);
			if (bytesRead != length) { // Don't have enough bytes.
				throw new InvalidDataTypeException(
					"Only read " + bytesRead + " bytes when trying to read " + length + "."); // throws Exception
			}
		}
		catch (MemoryAccessException e) {
			String message = "Couldn't read " + length + " bytes at " + startAddress + ".";
			throw new InvalidDataTypeException(message, e); // throws Exception
		}
		return bytes; // Only get here if getBytes() succeeds.
	}
Gets bytes from <code>memory</code> at the indicated <code>startAddress</code>. 
The <code>length</code> indicates the number of bytes that must be read 
from memory.
@param memory the program memory for obtaining the bytes
@param startAddress the address to begin reading bytes
@param length the number of bytes to read
@return the bytes
@throws InvalidDataTypeException if the <code>length</code> number of bytes couldn't 
be read starting at the <code>startAddress</code> in <code>memory</code>.
Ghidra/Features/Base/src/main/java/ghidra/app/util/datatype/microsoft/MSDataTypeUtils.java