neilharvey / FileSignatures

A small library for detecting the type of a file based on header signature (also known as magic number).
MIT License
250 stars 41 forks source link

File stream inspector does not reset the stream position #5

Closed cserkaran closed 6 years ago

cserkaran commented 6 years ago

Found an issue, after calling FileFormatInspector.DetermineFileFormat, the stream position is set to the byte position it read last during inspecting the file stream. This corrupts the passed stream, if the passed stream is to be uploaded to the file server the file is corrupted now. This is because the header bytes are missing because stream never reset back to its original position. As an API Consumer, I expect the stream to be in its original position which is Zero.