C# 클래스 OpenSyno.Services.ReadWriteMemoryStream

A memory stream with the ability to write data at the end of it while reading at an arbitrary position.
Only the Read and Write method were implemented. This stream can be typically used to start using the first chunks of data of a file before it is completely downloaded, when it is located on a slow link. Example : Start playing an mp3 file before it is completely downloaded.
상속: System.IO.MemoryStream
파일 보기 프로젝트 열기: salfab/open-syno

공개 메소드들

메소드 설명
BeginRead ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult
Close ( ) : void
Read ( byte buffer, int offset, int count ) : int

Reads a block of bytes from the current stream and writes the data to buffer.

ReadWriteMemoryStream ( int size ) : System

Initializes a new instance of the ReadWriteMemoryStream class.

Write ( byte buffer, int offset, int count ) : void

Writes a block of bytes to the current stream using data read from buffer.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

메소드 상세

BeginRead() 공개 메소드

public BeginRead ( byte buffer, int offset, int count, AsyncCallback callback, object state ) : IAsyncResult
buffer byte
offset int
count int
callback AsyncCallback
state object
리턴 IAsyncResult

Close() 공개 메소드

public Close ( ) : void
리턴 void

Dispose() 보호된 메소드

protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

Read() 공개 메소드

Reads a block of bytes from the current stream and writes the data to buffer.
is null. or is negative. subtracted from the buffer length is less than . The current stream instance is closed.
public Read ( byte buffer, int offset, int count ) : int
buffer byte When this method returns, contains the specified byte array with the values between and ( + - 1) replaced by the characters read from the current stream.
offset int The byte offset in at which to begin reading.
count int The maximum number of bytes to read.
리턴 int

ReadWriteMemoryStream() 공개 메소드

Initializes a new instance of the ReadWriteMemoryStream class.
public ReadWriteMemoryStream ( int size ) : System
size int The size.
리턴 System

Write() 공개 메소드

Writes a block of bytes to the current stream using data read from buffer.
is null. The stream does not support writing. For additional information see .-or- The current position is closer than bytes to the end of the stream, and the capacity cannot be modified. subtracted from the buffer length is less than . or are negative. An I/O error occurs. The current stream instance is closed.
public Write ( byte buffer, int offset, int count ) : void
buffer byte The buffer to write data from.
offset int The byte offset in at which to begin writing from.
count int The maximum number of bytes to write.
리턴 void