>I have adjusted the top portion of the class to use the FileStream. Basically, I only need to top 2048 characters. So, once I have that, I simply put that into lcString and the rest of the code is simply as it has always been.
>
>
>Try
>
> ' Get it into a stream
> loFile = New FileStream(lcFile, FileMode.Open, FileAccess.Read, FileShare.Read)
>
> ' If we can work with the file
> If loFile.CanSeek Then
>
> ' Initialization
> lnLength = loFile.Length
>
> ' Number of bytes to read
> lnByteToRead = 2048
>
> ' Maximum number of bytes to read
> If lnLength < 2048 Then
> lnByteToRead = lnLength
> End If
>
> ' Get the byte-order mark, if there is one
> loByte = New Byte(lnByteToRead) {}
>
> loFile.Read(loByte, 0, lnByteToRead - 1)
> Else
> cMessage = cUnableToReadTheFile
> Clear()
> Return False
> End If
>
> ' Close the file
> loFile.Close()
>
>Catch loError As Exception
>End Try
>
>' Initialization
>lcString = Encoding.Default.GetString(loByte)
>
You should really refactor the above to implement IDisposable on FileStream.
>So, that part is faster. However, I found out the biggest latency, on a specific ZIP file contains 31,000 files is when I do the unzip by using the WinZip Command Prompt utility. I will have to look at that.
Look at the System.IO.Compression library. You can open a zip file, get a list of all entries and, from that, get the stream for each entry. See example here:
https://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive.entries(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2but for each entry call the Open() method instead which will return a stream