When a file is opened for buffered I/O, the buffer is essentially transparent to the application. You can read, write, and seek in the same way as unbuffered I/O. To open a file using buffered file I/O, you can either provide an I/O buffer in an application, or allow the system to allocate an internal buffer. To provide a user-supplied I/O buffer, you can either use mmioOpen and have the pmmioinfo field point to the buffer, or use mmioSetBuffer (see the table of buffered I/O functions in the next subsection.) To provide a system-supplied buffer, specify the MMIO_ALLOCBUF option of the mmioOpen function. Unless you have a performance-sensitive application that directly accesses an I/O buffer or opens a memory file, it is a good idea to use the MMIO Manager to allocate the buffer. For example, the following code sample opens a DOS file and directs mmioOpen to allocate a standard-sized buffer.
hmmio = mmioOpen("EXAMPLE.DIB", NULL, MMIO_ALLOCBUF);