File
class and the FileInfo
class?File
class has static methods so it cannot be instantiated. It is best used for one-off tasks such as copying a file. The FileInfo
class requires the instantiation of an object that represents a file. It is best used when you need to perform multiple operations on the same file.ReadByte
method and the Read
method of a stream?ReadByte
method returns a single byte each time it is called and the Read
method fills a temporary array with bytes up to a specified length. It is generally best to use Read
to process blocks of bytes at once.StringReader
, TextReader
, and StreamReader
classes?StringReader
is used for efficiently reading from a string stored in memoryTextReader
is an abstract class that StringReader
and StreamReader
both inherit from for their shared functionalityStreamReader
is used for reading strings from a stream that can be any type of text file, including XML and JSONDeflateStream
type do?DeflateStream
implements the same compression algorithm as GZIP but without a cyclical redundancy check, so although it produces smaller compressed files, it cannot perform integrity checks when decompressing.Customer
object may have a property that references a set of Order
instances.3.17.157.6