private void switchToTempFileIfNecessary(int bytesToAdd) throws IOException {
			delegateLength += bytesToAdd;
			if (tmpFile == null && delegateLength > MAX_INMEM_FILESIZE) {
				tmpFile = createTempFile();
				byte[] bytes = ((ByteArrayOutputStream) delegate).toByteArray();
				delegate = new ObfuscatedOutputStream(new FileOutputStream(tmpFile));
				initHashingOutputStream();
				// send the old bytes through the new hasher and to the tmp file
				hos.write(bytes);
			}
		}
Allows creating {@link FileCacheEntry file cache entries} at the caller's convenience.
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/FileCache.java