ThingWorx C SDK
Public Member Functions | Properties | List of all members
DotZLib.GZipStream Class Reference

Implements a compressed Stream, in GZip (.gz) format. More...

Inheritance diagram for DotZLib.GZipStream:

Public Member Functions

 GZipStream (string fileName, CompressLevel level)
 Creates a new file as a writeable GZipStream More...
 
 GZipStream (string fileName)
 Opens an existing file as a readable GZipStream More...
 
void Dispose ()
 Closes the external file handle More...
 
override int Read (byte[] buffer, int offset, int count)
 Attempts to read a number of bytes from the stream. More...
 
override int ReadByte ()
 Attempts to read a single byte from the stream. More...
 
override void Write (byte[] buffer, int offset, int count)
 Writes a number of bytes to the stream More...
 
override void WriteByte (byte value)
 Writes a single byte to the stream More...
 
override void SetLength (long value)
 Not supported. More...
 
override long Seek (long offset, SeekOrigin origin)
 Not suppported. More...
 
override void Flush ()
 Flushes the GZipStream. More...
 

Properties

override bool CanRead [get]
 Returns true of this stream can be read from, false otherwise More...
 
override bool CanSeek [get]
 Returns false. More...
 
override bool CanWrite [get]
 Returns true if this tsream is writeable, false otherwise More...
 
override long Position [get, set]
 Gets/sets the current position in the GZipStream. Not suppported. More...
 
override long Length [get]
 Gets the size of the stream. Not suppported. More...
 

Detailed Description

Implements a compressed Stream, in GZip (.gz) format.

Constructor & Destructor Documentation

DotZLib.GZipStream.GZipStream ( string  fileName,
CompressLevel  level 
)
inline

Creates a new file as a writeable GZipStream

Parameters
fileNameThe name of the compressed file to create
levelThe compression level to use when adding data
Exceptions
ZLibExceptionIf an error occurred in the internal zlib function
DotZLib.GZipStream.GZipStream ( string  fileName)
inline

Opens an existing file as a readable GZipStream

Parameters
fileNameThe name of the file to open
Exceptions
ZLibExceptionIf an error occurred in the internal zlib function

Member Function Documentation

void DotZLib.GZipStream.Dispose ( )
inline

Closes the external file handle

override void DotZLib.GZipStream.Flush ( )
inline

Flushes the GZipStream.

In this implementation, this method does nothing. This is because excessive flushing may degrade the achievable compression rates.

override int DotZLib.GZipStream.Read ( byte[]  buffer,
int  offset,
int  count 
)
inline

Attempts to read a number of bytes from the stream.

Parameters
bufferThe destination data buffer
offsetThe index of the first destination byte in buffer
countThe number of bytes requested
Returns
The number of bytes read
Exceptions
ArgumentNullExceptionIf buffer is null
ArgumentOutOfRangeExceptionIf count or offset are negative
ArgumentExceptionIf offset + count is > buffer.Length
NotSupportedExceptionIf this stream is not readable.
ObjectDisposedExceptionIf this stream has been disposed.
override int DotZLib.GZipStream.ReadByte ( )
inline

Attempts to read a single byte from the stream.

Returns
The byte that was read, or -1 in case of error or End-Of-File
override long DotZLib.GZipStream.Seek ( long  offset,
SeekOrigin  origin 
)
inline

Not suppported.

Parameters
offset
origin
Returns
Exceptions
NotSupportedExceptionAlways thrown
override void DotZLib.GZipStream.SetLength ( long  value)
inline

Not supported.

Parameters
value
Exceptions
NotSupportedExceptionAlways thrown
override void DotZLib.GZipStream.Write ( byte[]  buffer,
int  offset,
int  count 
)
inline

Writes a number of bytes to the stream

Parameters
buffer
offset
count
Exceptions
ArgumentNullExceptionIf buffer is null
ArgumentOutOfRangeExceptionIf count or offset are negative
ArgumentExceptionIf offset + count is > buffer.Length
NotSupportedExceptionIf this stream is not writeable.
ObjectDisposedExceptionIf this stream has been disposed.
override void DotZLib.GZipStream.WriteByte ( byte  value)
inline

Writes a single byte to the stream

Parameters
valueThe byte to add to the stream.
Exceptions
NotSupportedExceptionIf this stream is not writeable.
ObjectDisposedExceptionIf this stream has been disposed.

Property Documentation

override bool DotZLib.GZipStream.CanRead
get

Returns true of this stream can be read from, false otherwise

override bool DotZLib.GZipStream.CanSeek
get

Returns false.

override bool DotZLib.GZipStream.CanWrite
get

Returns true if this tsream is writeable, false otherwise

override long DotZLib.GZipStream.Length
get

Gets the size of the stream. Not suppported.

In this implementation this property is not supported

Exceptions
NotSupportedExceptionAlways thrown
override long DotZLib.GZipStream.Position
getset

Gets/sets the current position in the GZipStream. Not suppported.

In this implementation this property is not supported

Exceptions
NotSupportedExceptionAlways thrown

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