private static InputBlockStream getInputBlockStream(BufferFile bufferFile) throws IOException {
		// This method is used so we can utilize a package method and avoid putting
		// it on the BufferFile interface
		if (bufferFile instanceof BufferFileAdapter) {
			return ((BufferFileAdapter) bufferFile).getInputBlockStream();
		}
		if (bufferFile instanceof LocalBufferFile) {
			return ((LocalBufferFile) bufferFile).getInputBlockStream();
		}
		throw new IllegalArgumentException(
			"Unsupported buffer file implementation: " + bufferFile.getClass().getName());
	}
Factory method for generating the appropriate type of {@link InputBlockStream}
for the specified read-only bufferFile.  Input stream may not supply header block in which case
free list and file parameters may need to be set separately.
@param bufferFile buffer file opened read-only
@return input block stream object
@throws IOException if an I/O error occurs
Ghidra/Framework/DB/src/main/java/db/buffers/LocalBufferFile.java