C# Class NSoft.NFramework.Parallelism.Tools.StreamAsync

비동기적 스트림 작업에 쓰이는 Extension Method 들입니다.
참고 사이트 : http://msdn.microsoft.com/ko-kr/library/ms228963.aspx http://msdn.microsoft.com/ko-kr/library/dd997423.aspx
Datei anzeigen Open project: debop/NFramework

Public Methods

Method Description
CopyStreamToFileAsync ( this source, string destinationPath ) : System.Threading.Tasks.Task

source를 읽어 destinationPath 의 파일에 비동기적으로 씁니다.

CopyStreamToStreamAsync ( this source, Stream destination ) : System.Threading.Tasks.Task

source를 읽어 destination에 비동기적으로 씁니다.

ReadAllBytesAsync ( this stream ) : Task

stream의 모든 Data를 비동기 방식으로 읽는 작업을 생성합니다.

ReadAsync ( this stream, byte buffer, int offset, int count ) : Task

지정된 스트림을 비동기 방식으로 읽어, buffer에 채웁니다. 작업의 결과는 읽은 바이트 수입니다.

ReadBufferAsync ( this stream, int bufferSize, int>.Action bufferAvailable ) : System.Threading.Tasks.Task

stream 을 비동기 방식으로 반복해서 읽어드리는 Task를 빌드합니다.

WriteAsync ( this stream, byte buffer, int offset, int count ) : System.Threading.Tasks.Task

buffer 내용을 지정된 스트림에 비동기 방식으로 씁니다.

Private Methods

Method Description
CopyStreamIterator ( Stream input, Stream output ) : IEnumerable
ReadIterator ( Stream input, int bufferSize, int>.Action bufferAvailable ) : IEnumerable

Method Details

CopyStreamToFileAsync() public static method

source를 읽어 destinationPath 의 파일에 비동기적으로 씁니다.
public static CopyStreamToFileAsync ( this source, string destinationPath ) : System.Threading.Tasks.Task
source this
destinationPath string
return System.Threading.Tasks.Task

CopyStreamToStreamAsync() public static method

source를 읽어 destination에 비동기적으로 씁니다.
public static CopyStreamToStreamAsync ( this source, Stream destination ) : System.Threading.Tasks.Task
source this
destination Stream
return System.Threading.Tasks.Task

ReadAllBytesAsync() public static method

stream의 모든 Data를 비동기 방식으로 읽는 작업을 생성합니다.
public static ReadAllBytesAsync ( this stream ) : Task
stream this
return Task

ReadAsync() public static method

지정된 스트림을 비동기 방식으로 읽어, buffer에 채웁니다. 작업의 결과는 읽은 바이트 수입니다.
public static ReadAsync ( this stream, byte buffer, int offset, int count ) : Task
stream this
buffer byte
offset int
count int
return Task

ReadBufferAsync() public static method

stream 을 비동기 방식으로 반복해서 읽어드리는 Task를 빌드합니다.
public static ReadBufferAsync ( this stream, int bufferSize, int>.Action bufferAvailable ) : System.Threading.Tasks.Task
stream this 읽을 스트림 객체
bufferSize int 한번에 읽을 버퍼 크기
bufferAvailable int>.Action 읽은 버퍼가 유효한 것인지 판단하는 델리게이트
return System.Threading.Tasks.Task

WriteAsync() public static method

buffer 내용을 지정된 스트림에 비동기 방식으로 씁니다.
public static WriteAsync ( this stream, byte buffer, int offset, int count ) : System.Threading.Tasks.Task
stream this
buffer byte
offset int
count int
return System.Threading.Tasks.Task