C# Class ICSharpCode.SharpZipLib.Tests.TestSupport.WindowedStream

A Stream that supports reading and writing from a fixed size memory buffer. This provides the ability to test writing and reading from very large streams without using any disk storeage
Inheritance: Stream
Afficher le fichier Open project: icsharpcode/SharpZipLib Class Usage Examples

Méthodes publiques

Méthode Description
Close ( ) : void

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.

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.

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.

WindowedStream ( int size ) : System

Initializes a new instance of the WindowedStream class.

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.

Method Details

Close() public méthode

Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
public Close ( ) : void
Résultat void

Flush() public méthode

When overridden in a derived class, 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
Résultat void

Read() public méthode

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 and is larger than the buffer length. /// is null. /// or is negative. An I/O error occurs. The stream does not support reading. Methods were called after the stream was closed.
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 and ( + - 1) replaced by the bytes read from the current source.
offset int The zero-based byte offset in 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.
Résultat int

Seek() public méthode

When overridden in a derived class, sets the position within the current stream.
An I/O error occurs. The 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 parameter.
origin SeekOrigin A value of type indicating the reference point used to obtain the new position.
Résultat long

SetLength() public méthode

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

WindowedStream() public méthode

Initializes a new instance of the WindowedStream class.
public WindowedStream ( int size ) : System
size int The size.
Résultat System

Write() public méthode

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.
The sum of and is greater than the buffer length. /// is null. /// or is negative. An I/O error occurs. The stream does not support writing. Methods were called after the stream was closed.
public Write ( byte buffer, int offset, int count ) : void
buffer byte An array of bytes. This method copies bytes from to the current stream.
offset int The zero-based byte offset in at which to begin copying bytes to the current stream.
count int The number of bytes to be written to the current stream.
Résultat void