C# 클래스 Dicom.Network.ThrottleStream

Class for streaming data with throttling support.
상속: Stream
파일 보기 프로젝트 열기: fo-dicom/mdcm

공개 메소드들

메소드 설명
Close ( ) : void

Closes this stream.

Flush ( ) : void

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

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

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

Sets the position within the current stream.

SetLength ( long value ) : void

Sets the length of the current stream.

ThrottleStream ( Stream baseStream ) : System

Initializes a new instance of the T:ThrottledStream class with an infinite amount of bytes that can be processed.

ThrottleStream ( Stream baseStream, long maximumBytesPerSecond ) : System

Initializes a new instance of the T:ThrottledStream class.

ToString ( ) : string

Returns a that represents the current .

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

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

보호된 메소드들

메소드 설명
Reset ( ) : void

Will reset the bytecount to 0 and reset the start time to the current time.

Throttle ( int bufferSizeInBytes ) : void

Throttles for the specified buffer size in bytes.

메소드 상세

Close() 공개 메소드

Closes this stream.
public Close ( ) : void
리턴 void

Flush() 공개 메소드

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
An I/O error occurs.
public Flush ( ) : void
리턴 void

Read() 공개 메소드

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 base stream does not support reading. buffer 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

Reset() 보호된 메소드

Will reset the bytecount to 0 and reset the start time to the current time.
protected Reset ( ) : void
리턴 void

Seek() 공개 메소드

Sets the position within the current stream.
An I/O error occurs. The base stream does not support seeking, such as if the stream is constructed from a pipe or console output. Methods were called after the stream was closed.
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() 공개 메소드

Sets the length of the current stream.
The base stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. An I/O error occurs. Methods were called after the stream was closed.
public SetLength ( long value ) : void
value long The desired length of the current stream in bytes.
리턴 void

Throttle() 보호된 메소드

Throttles for the specified buffer size in bytes.
protected Throttle ( int bufferSizeInBytes ) : void
bufferSizeInBytes int The buffer size in bytes.
리턴 void

ThrottleStream() 공개 메소드

Initializes a new instance of the T:ThrottledStream class with an infinite amount of bytes that can be processed.
public ThrottleStream ( Stream baseStream ) : System
baseStream Stream The base stream.
리턴 System

ThrottleStream() 공개 메소드

Initializes a new instance of the T:ThrottledStream class.
Thrown when is a null reference. Thrown when is a negative value.
public ThrottleStream ( Stream baseStream, long maximumBytesPerSecond ) : System
baseStream Stream The base stream.
maximumBytesPerSecond long The maximum bytes per second that can be transferred through the base stream.
리턴 System

ToString() 공개 메소드

Returns a that represents the current .
public ToString ( ) : string
리턴 string

Write() 공개 메소드

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 base stream does not support writing. Methods were called after the stream was closed. buffer 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