C# 클래스 Renci.SshNet.Common.PipeStream

PipeStream is a thread-safe read/write data stream for use between two threads in a single-producer/single-consumer type problem.
Update on 2008/10/9 1.1 - uses Monitor instead of Manual Reset events for more elegant synchronicity.
상속: Stream
파일 보기 프로젝트 열기: sshnet/SSH.NET 1 사용 예제들

공개 메소드들

메소드 설명
Flush ( ) : void

When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.

Once flushed, any subsequent read operations no longer block until requested bytes are available. Any write operation reactivates blocking reads.

Read ( byte buffer, int offset, int count ) : int

When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Seek ( long offset, SeekOrigin origin ) : long

When overridden in a derived class, sets the position within the current stream.

SetLength ( long value ) : void

When overridden in a derived class, sets the length of the current stream.

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

When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

보호된 메소드들

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

Releases the unmanaged resources used by the Stream and optionally releases the managed resources.

Disposing a PipeStream will interrupt blocking read and write operations.

비공개 메소드들

메소드 설명
CreateObjectDisposedException ( ) : ObjectDisposedException
ReadAvailable ( int count ) : bool

Returns true if there are

메소드 상세

Dispose() 보호된 메소드

Releases the unmanaged resources used by the Stream and optionally releases the managed resources.
Disposing a PipeStream will interrupt blocking read and write operations.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
리턴 void

Flush() 공개 메소드

When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
Once flushed, any subsequent read operations no longer block until requested bytes are available. Any write operation reactivates blocking reads.
An I/O error occurs. Methods were called after the stream was closed.
public Flush ( ) : void
리턴 void

Read() 공개 메소드

When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
The sum of offset and count is larger than the buffer length. Methods were called after the stream was closed. The stream does not support reading. is null. An I/O error occurs. offset or count is negative.
public Read ( byte buffer, int offset, int count ) : int
buffer byte An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
offset int The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
count int The maximum number of bytes to be read from the current stream.
리턴 int

Seek() 공개 메소드

When overridden in a derived class, sets the position within the current stream.
The stream does not support seeking, such as if the stream is constructed from a pipe or console output.
public Seek ( long offset, SeekOrigin origin ) : long
offset long A byte offset relative to the origin parameter.
origin SeekOrigin A value of type indicating the reference point used to obtain the new position.
리턴 long

SetLength() 공개 메소드

When overridden in a derived class, sets the length of the current stream.
The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.
public SetLength ( long value ) : void
value long The desired length of the current stream in bytes.
리턴 void

Write() 공개 메소드

When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
An I/O error occurs. The stream does not support writing. Methods were called after the stream was closed. is null. The sum of offset and count is greater than the buffer length. offset or count is negative.
public Write ( byte buffer, int offset, int count ) : void
buffer byte An array of bytes. This method copies count bytes from buffer to the current stream.
offset int The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
count int The number of bytes to be written to the current stream.
리턴 void