Reputation: 1005
I am writing a few bytes to a newly created file in Visual Basic. The following code is executed:
compressedFileStream.WriteByte(&H00)
compressedFileStream.WriteByte(&H00)
compressedFileStream.WriteByte(&H00)
compressedFileStream.WriteByte(&H00)
compressedFileStream.WriteByte(&H00)
compressedFileStream.WriteByte(&HD5)
compressedFileStream.WriteByte(&H55)
compressedFileStream.WriteByte(&H6E)
compressedFileStream.WriteByte(&H49)
Unfortunately the output is not what I wrote. Using Notepad++ I see this result:
Creation of compressedFileStream:
Using compressedFileStream As FileStream = File.Create(ArchivePath & ".zip")
The D0 and B5 are wrong. After those two bytes that magically appeared it will continue with the correct bytes (55, 6E and 49). Did anyone actually experience this or does anyone know what can cause this?
Upvotes: 0
Views: 55
Reputation: 6374
I tried your code and it works as expected. Is there any other process that takes place after the WriteByte
statements are executed?
Or, perhaps Notepad++ is playing tricks on you.
Upvotes: 1