Filestream, streamreader, streamwriter, textreader, textwriter, binaryreader, binarywriter

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.