public FileCacheEntry finish() throws IOException {
			if (hos != null) {
				hos.close();
				String md5 = NumericUtilities.convertBytesToString(hos.getDigest());
				if (tmpFile != null) {
					fce = addTmpFileToCache(tmpFile, md5);
				}
				else {
					ByteArrayOutputStream baos = (ByteArrayOutputStream) delegate;
					byte[] bytes = baos.toByteArray();
					fce = new FileCacheEntry(bytes, md5);
					synchronized (FileCache.this) {
						memCache.put(md5, fce);
					}
				}
				hos = null;
				delegate = null;
			}
			return fce;
		}
Finalizes this builder, pushing the bytes that have been written to it into
the FileCache.

@return new {@link FileCacheEntry}
@throws IOException if error
Ghidra/Features/Base/src/main/java/ghidra/formats/gfilesystem/FileCache.java