You work as the application developer at Domain.com. Domain.com uses Visual Studio.NET 2005 as its application development platform.
You are developing a .NET Framework 2.0 data analysis application.
You have no information about the inherent structure of a file when it is supplied to the program for reading data.
You are required to read the contents of the file byte-by-byte and make use of a custom algorithm to find its format whilst selecting a class
that allows you to read the files contents byte-by-byte.
What should you do?
A.
Use the FileStream class.
B.
Use the BinaryReader class.
C.
Use the StreamReader class.
D.
Use the StringReader class.
Explanation:
The purpose and function of the FileStream class is to allow the user to be able to view the required files byte-by-byte.
Incorrect Answers:
B: The BinaryReader class is use full if you know the binary format for the data to read but should not be considered for use in the scenario.
C: This method is use full if you want to read character data in a particular encoding, but is not useful for reading any other data.
D: This class is used for reading text from a string and is not use full for reading any other data.
I agree with the answer. A