AMPS C# Client  5.3.5.0
AMPS C# Client for .NET
AMPS.Client.ZlibIOStream Class Reference

A System.IO.Stream wrapper around the ComponentAce zlib implementation which works bidirectionally and eliminates a data copy. More...

+ Inheritance diagram for AMPS.Client.ZlibIOStream:

Public Member Functions

 ZlibIOStream (Stream underlying, int windowSize)
 Initializes a new instance of the ZlibIOStream class with the specified underlying stream and window size. More...
 
override void Flush ()
 Writes any data buffered in the internal buffer to the underlying device. More...
 
override int Read (byte[] buffer, int offset, int count)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. More...
 
override long Seek (long offset, SeekOrigin origin)
 Sets the position within the current stream. More...
 
override void SetLength (long value)
 Sets the length of the current stream. More...
 
override void Write (byte[] buffer, int offset, int count)
 Writes a sequence of bytes to the current stream and advances the position within the stream by the number of bytes written. More...
 

Public Attributes

ComponentAce.Compression.Libs.zlib.ZStream _deflaterZStream = new ZStream()
 
ComponentAce.Compression.Libs.zlib.ZStream _inflaterZStream = new ZStream()
 
Stream _underlying
 
int _deflateMarker = 0
 
byte[] _deflateBuffer = new byte[16384]
 

Properties

override bool CanRead [get]
 Gets a value indicating whether the stream supports reading. More...
 
override bool CanSeek [get]
 Gets a value indicating whether the stream supports seeking. More...
 
override bool CanWrite [get]
 Gets a value indicating whether the stream supports writing. More...
 
override long Length [get]
 Gets the length of the stream. More...
 
override long Position [get, set]
 Gets or sets the position within the current stream. More...
 

Detailed Description

A System.IO.Stream wrapper around the ComponentAce zlib implementation which works bidirectionally and eliminates a data copy.

Constructor & Destructor Documentation

◆ ZlibIOStream()

AMPS.Client.ZlibIOStream.ZlibIOStream ( Stream  underlying,
int  windowSize 
)
inline

Initializes a new instance of the ZlibIOStream class with the specified underlying stream and window size.

Parameters
underlyingThe underlying stream.
windowSizeThe window size.

Member Function Documentation

◆ Flush()

override void AMPS.Client.ZlibIOStream.Flush ( )
inline

Writes any data buffered in the internal buffer to the underlying device.

◆ Read()

override int AMPS.Client.ZlibIOStream.Read ( byte[]  buffer,
int  offset,
int  count 
)
inline

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters
bufferAn 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.
offsetThe zero-based byte offset in buffer at which to begin storing the data read from the current stream.
countThe maximum number of bytes to be read from the current stream.
Returns
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream is reached before any bytes are read.

◆ Seek()

override long AMPS.Client.ZlibIOStream.Seek ( long  offset,
SeekOrigin  origin 
)
inline

Sets the position within the current stream.

Parameters
offsetThe byte offset to seek.
originThe reference point from which to obtain the new position.
Returns
The new position within the current stream.

◆ SetLength()

override void AMPS.Client.ZlibIOStream.SetLength ( long  value)
inline

Sets the length of the current stream.

Parameters
valueThe desired length of the current stream in bytes.

◆ Write()

override void AMPS.Client.ZlibIOStream.Write ( byte[]  buffer,
int  offset,
int  count 
)
inline

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

Parameters
bufferThe byte array containing the data to write.
offsetThe zero-based byte offset in buffer at which to begin copying bytes to the current stream.
countThe number of bytes to be written to the current stream.

Property Documentation

◆ CanRead

override bool AMPS.Client.ZlibIOStream.CanRead
get

Gets a value indicating whether the stream supports reading.

◆ CanSeek

override bool AMPS.Client.ZlibIOStream.CanSeek
get

Gets a value indicating whether the stream supports seeking.

◆ CanWrite

override bool AMPS.Client.ZlibIOStream.CanWrite
get

Gets a value indicating whether the stream supports writing.

◆ Length

override long AMPS.Client.ZlibIOStream.Length
get

Gets the length of the stream.

◆ Position

override long AMPS.Client.ZlibIOStream.Position
getset

Gets or sets the position within the current stream.


The documentation for this class was generated from the following file: