I have a legacy 8-bit extended-ASCII text file (using the default code page) that I want to read line by line, convert to a C# string, manipulate and write back to a file.
If I use the TextReader class to do this, it strips off the high bit, which ruins the file as it has characters with a value above 128.
If I use the BinaryReader, it works, but the conversion to Unicode internally is EXTREMELY slow. The code is in the attached zip file, it works, but it is too slow.
The task for this project is to optimize these routines and create a class for efficiently reading and writing "strings" to 8-bit legacy files. As I read the stream documentation at MSDN it seems like this should be possible to use built in classes to avoid the conversion from binary to unicode strings on a character by character basis, particularly with the string builder that seems very slow. I just can't figure out how to get the internal classes to do this.
Attached are two files, [login to view URL] that contains code snippets that work, but are too slow, and [login to view URL] that contains a small sample of the type of text I'm reading.
Your program should have a test harness with timers (to show the difference between various approaches, including my current approach) and a minimal GUI for testing.
Documentation and testing are required (although in this case they should be fairly minimal.)
Acceptable code must be at least two times as fast as the current approach (I don't think this should be very difficult, honestly)
-Kelly
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
C# .NET enabled Windows.