VB6 inefficiency using INPUT
I have a VB6 program which reads fixed length records in Binary mode using the INPUT function with a length. Then the program performs some logic and outputs the input records as well as occasionally generated additional records using the PRINT# function. On a test of a small file of 600,000 records my throughput is over 5000 records per second with simulated reading + logic and no output. In another test my throughput is over 4000 records per second with simulated reading + logic + all output. I found my performance issue in a 3rd test where my throughput is 238 records per second with actual reading + logic + no output. There is definitely a performance issue with the INPUT function in VB6. I have found some efficiency gain by performing I/O in 32k chunks and refreshing my progress window less frequently. But I have to find a different method of reading my input file. The input file contains binary data as well as commas and it does not have length identifiers. So I think FileSystemObject methods and any other textstream or line data methods are out. The programs which later use the output file do not support database operations. So that option is out too.
Short of writing a high performance read subroutine in C or Cobol are there any methods of reading a variable number of bytes near 32k from a disk file within VB?