C # FileStream.Read Method

Source: Internet
Author: User
Reads a block of bytes from the stream and writes the data in a given buffer.

public override int Read (byte[] array,int offset,int count)


Parameters

    • array

    • Type: Listen system.byte[]

      when This method returns, contains the specified byte array with the values between listen offset Listen and (offset Listen + listen count Listen-1 ) listen to replaced by the bytes read from the current source.

    • Offset

    • Type: Listen System.Int32

      The byte offset in listen array listens at which the read bytes would be placed.

    • Count

    • Type: Listen System.Int32

      The maximum number of bytes to read.

Return Value

Type: Listen System.Int32
The total number of bytes read into the buffer. This might is less than the number of bytes requested if that number of bytes is not currently available, or zero if the End of the stream is reached.

Exceptions



Exception Condition
argumentnullexception

array listen to is listen null .

ArgumentOutOfRangeException

offset Listen or listen count listen to is negative.

NotSupportedException

The stream does not a support reading.

IOException

An I/O error occurred.

ArgumentException

offset Listen and listen to count Listen describe an invalid range in listen to array.

ObjectDisposedException

Methods were called after the stream was closed.


The above is the content of C # FileStream.Read method, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.