Can someone provide an example or primer on working with files on a granular level with C#. Let's assume that I want to build a new program to compress and zip files. Can I write a program like this, with C#, that gets down to the bits & bytes level?
+1
A:
I do not know of a good tutorial but BinaryReader is a good place to start for reading on the "bits & bytes" level
Scott Chamberlain
2010-05-19 18:23:35
+5
A:
You can surely read files byte by byte by using FileStream-class and the StreamReader-class. BinaryReader is even more granular. Having the bytes you will have the possibilty to work on bit-base with the bit-operators (|, &, <<, >>).
Examples can be found at the posted links.
P.S: You could use SharpZipLib or the Compression classes of .Net to compress files.
Simon
2010-05-19 18:24:18
A:
You can download the free #ziplib library including C# source code here:
http://www.icsharpcode.net/opensource/sharpziplib/
That should show you how to zip files at least.
ho1
2010-05-19 18:25:23
great resource, thanks.
Jim Beam
2010-05-21 15:37:31