FilestreamForFile SystemUpperRead and WriteFiles are very useful. filestream caches input and output for better performance. The filestream object indicates the stream that points to the file on the disk or network path. This class providesRead/write bytesBut streamreader or streamwriter is often used to execute these functions. This is because the filesteam class operates on Byte and byte arrays, while the stream class operates on character data. Filestream can only process raw bytes. The filestream class can be used to process any data files. By reading byte data, the filestream object can be used to read graphics and sound. The cost is that the filestream class cannot directly read data into strings.
Filestream common attributes and methods.
Flush (): writes data in the current buffer to a file.
StreamreaderClass
Implement a textreader to read characters from the byte stream with a specific encoding.
StreamwriterClass
Implements a textwriter so that it writes characters to the stream in a specific encoding.
TextreaderClass
The reader that can read the continuous character series.
TextwriterClass
Indicates that an ordered character series writer can be compiled. This class is an abstract class.
BinaryreaderClass
The base metadata type is read as a binary value using a specific encoding.
Binarywriter
Writes the primitive type to the stream in binary format, and supports writing strings with specific encoding.
The binarywriter and binaryreader classes are used to read and write data, rather than strings.
Streamreader. basestream
Returns the base stream.