Прочитај на енглеском Уреди

Делите путем


FileStream.CopyTo(Stream, Int32) Method

Definition

Reads the bytes from the current stream and writes them to another stream, using a specified buffer size. Both streams positions are advanced by the number of bytes copied.

C#
public override void CopyTo(System.IO.Stream destination, int bufferSize);

Parameters

destination
Stream

The stream to which the contents of the current stream will be copied.

bufferSize
Int32

The size of the buffer. This value must be greater than zero.

Remarks

Copying begins at the current position in the current stream, and does not reset the position of the destination stream after the copy operation is complete.

Applies to

Производ Верзије
.NET 9, 10