private void establishNextBuffer() throws IOException {
			while (dataUpNext < dataBlocks.size()) {
				OmfData omfData = dataBlocks.get(dataUpNext);
				if (pointer < omfData.getDataOffset()) {
					// We have some fill to produce before the next section
					long size = omfData.getDataOffset() - pointer;
					if (size > OmfLoader.MAX_UNINITIALIZED_FILL) {
						throw new IOException(
							"Unfilled hole in OMF data blocks for segment: " + segmentName);
					}
					buffer = new byte[(int) size];
					for (int i = 0; i < size; ++i) {
						buffer[i] = 0;
					}
					bufferpointer = 0;
					return;
				}
				else if (pointer == omfData.getDataOffset()) {
					buffer = omfData.getByteArray(reader);
					bufferpointer = 0;
					dataUpNext++;
					if (buffer.length == 0) {
						continue;
					}
					return;
				}
				else {
					dataUpNext++;
					throw new IOException(String.format(
						"Segment %s:%s has bad data offset (0x%x) in data block %d...skipping.",
						segmentName, className, omfData.getDataOffset(), dataUpNext - 1));
				}
			}
			// We may have filler after the last block
			long size = segmentLength.value() - pointer;
			if (size > OmfLoader.MAX_UNINITIALIZED_FILL) {
				throw new IOException("Large hole at the end of OMF segment: " + segmentName);
			}
			buffer = new byte[(int) size];
			for (int i = 0; i < size; ++i) {
				buffer[i] = 0;
			}
			bufferpointer = 0;
		}
Fill the next buffer of bytes being provided by this stream.
@throws IOException for problems with the file image reader
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/omf/omf/OmfSegmentHeader.java