Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
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. More...
 
override long Length [get]
 Gets the size of the stream. More...
 

Detailed Description

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

Definition at line 17 of file GZipStream.cs.

Constructor & Destructor Documentation

◆ GZipStream() [1/2]

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

Definition at line 53 of file GZipStream.cs.

◆ GZipStream() [2/2]

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

Definition at line 66 of file GZipStream.cs.

References DotZLib.GZipStream.CanRead.

Member Function Documentation

◆ Dispose()

void DotZLib.GZipStream.Dispose ( )
inline

Closes the external file handle

Definition at line 125 of file GZipStream.cs.

References DotZLib.GZipStream.CanRead, and DotZLib.GZipStream.Read().

◆ Flush()

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.

Definition at line 265 of file GZipStream.cs.

References DotZLib.GZipStream.Position.

◆ Read()

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.

Definition at line 154 of file GZipStream.cs.

Referenced by DotZLib.GZipStream.Dispose().

◆ ReadByte()

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

Definition at line 181 of file GZipStream.cs.

References DotZLib.GZipStream.CanRead.

◆ Seek()

override long DotZLib.GZipStream.Seek ( long  offset,
SeekOrigin  origin 
)
inline

Not suppported.

Parameters
offset
origin
Returns
Exceptions
NotSupportedExceptionAlways thrown

Definition at line 255 of file GZipStream.cs.

◆ SetLength()

override void DotZLib.GZipStream.SetLength ( long  value)
inline

Not supported.

Parameters
value
Exceptions
NotSupportedExceptionAlways thrown

Definition at line 243 of file GZipStream.cs.

Referenced by DotZLib.GZipStream.WriteByte().

◆ Write()

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.

Definition at line 199 of file GZipStream.cs.

References DotZLib.GZipStream.CanWrite.

◆ WriteByte()

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.

Definition at line 226 of file GZipStream.cs.

References DotZLib.GZipStream.CanWrite, and DotZLib.GZipStream.SetLength().

Property Documentation

◆ CanRead

override bool DotZLib.GZipStream.CanRead
get

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

Definition at line 81 of file GZipStream.cs.

Referenced by DotZLib.GZipStream.Dispose(), DotZLib.GZipStream.GZipStream(), and DotZLib.GZipStream.ReadByte().

◆ CanSeek

override bool DotZLib.GZipStream.CanSeek
get

Returns false.

Definition at line 93 of file GZipStream.cs.

◆ CanWrite

override bool DotZLib.GZipStream.CanWrite
get

Returns true if this tsream is writeable, false otherwise

Definition at line 104 of file GZipStream.cs.

Referenced by DotZLib.GZipStream.Write(), and DotZLib.GZipStream.WriteByte().

◆ Length

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

Definition at line 293 of file GZipStream.cs.

◆ Position

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

Definition at line 276 of file GZipStream.cs.

Referenced by DotZLib.GZipStream.Flush().


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