Rizin
unix-like reverse engineering framework and cli tools
|
Implements a compressed Stream, in GZip (.gz) format. More...
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... | |
Private Member Functions | |
static IntPtr | gzopen (string name, string mode) |
static int | gzclose (IntPtr gzFile) |
static int | gzwrite (IntPtr gzFile, int data, int length) |
static int | gzread (IntPtr gzFile, int data, int length) |
static int | gzgetc (IntPtr gzFile) |
static int | gzputc (IntPtr gzFile, int c) |
~GZipStream () | |
Destroys this instance More... | |
void | cleanUp (bool isDisposing) |
Private Attributes | |
IntPtr | _gzFile |
bool | _isDisposed = false |
bool | _isWriting |
Additional Inherited Members | |
Public Attributes inherited from Stream | |
const char * | input |
const char * | start |
const char * | end |
int32_t | next |
uint8_t | next_size |
Implements a compressed Stream, in GZip (.gz) format.
Definition at line 17 of file GZipStream.cs.
|
inline |
Creates a new file as a writeable GZipStream
fileName | The name of the compressed file to create |
level | The compression level to use when adding data |
ZLibException | If an error occurred in the internal zlib function |
Definition at line 53 of file GZipStream.cs.
References DotZLib.GZipStream._gzFile, DotZLib.GZipStream._isWriting, test-lz4-speed.fileName, DotZLib.GZipStream.gzopen(), and level.
|
inline |
Opens an existing file as a readable GZipStream
fileName | The name of the file to open |
ZLibException | If an error occurred in the internal zlib function |
Definition at line 66 of file GZipStream.cs.
References DotZLib.GZipStream._gzFile, DotZLib.GZipStream._isWriting, test-lz4-speed.fileName, and DotZLib.GZipStream.gzopen().
|
inlineprivate |
Destroys this instance
Definition at line 117 of file GZipStream.cs.
References DotZLib.GZipStream.cleanUp().
|
inlineprivate |
Definition at line 131 of file GZipStream.cs.
References DotZLib.GZipStream._gzFile, DotZLib.GZipStream._isDisposed, and DotZLib.GZipStream.gzclose().
Referenced by DotZLib.GZipStream.Dispose(), and DotZLib.GZipStream.~GZipStream().
|
inline |
Closes the external file handle
Definition at line 125 of file GZipStream.cs.
References DotZLib.GZipStream.cleanUp().
|
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.
|
private |
Referenced by DotZLib.GZipStream.cleanUp().
|
private |
Referenced by DotZLib.GZipStream.ReadByte().
|
private |
Referenced by DotZLib.GZipStream.GZipStream().
Referenced by DotZLib.GZipStream.WriteByte().
Referenced by DotZLib.GZipStream.Read().
Referenced by DotZLib.GZipStream.Write().
Attempts to read a number of bytes from the stream.
buffer | The destination data buffer |
offset | The index of the first destination byte in buffer |
count | The number of bytes requested |
ArgumentNullException | If buffer is null |
ArgumentOutOfRangeException | If count or offset are negative |
ArgumentException | If offset + count is > buffer.Length |
NotSupportedException | If this stream is not readable. |
ObjectDisposedException | If this stream has been disposed. |
Definition at line 154 of file GZipStream.cs.
References DotZLib.GZipStream._gzFile, DotZLib.GZipStream._isDisposed, DotZLib.GZipStream.CanRead, count, DotZLib.GZipStream.gzread(), and h.
|
inline |
Attempts to read a single byte from the stream.
Definition at line 181 of file GZipStream.cs.
References DotZLib.GZipStream._gzFile, DotZLib.GZipStream._isDisposed, DotZLib.GZipStream.CanRead, and DotZLib.GZipStream.gzgetc().
Not suppported.
offset | |
origin |
NotSupportedException | Always thrown |
Definition at line 255 of file GZipStream.cs.
|
inline |
Not supported.
value |
NotSupportedException | Always thrown |
Definition at line 243 of file GZipStream.cs.
Writes a number of bytes to the stream
buffer | |
offset | |
count |
ArgumentNullException | If buffer is null |
ArgumentOutOfRangeException | If count or offset are negative |
ArgumentException | If offset + count is > buffer.Length |
NotSupportedException | If this stream is not writeable. |
ObjectDisposedException | If this stream has been disposed. |
Definition at line 199 of file GZipStream.cs.
References DotZLib.GZipStream._gzFile, DotZLib.GZipStream._isDisposed, DotZLib.GZipStream.CanWrite, count, DotZLib.GZipStream.gzwrite(), and h.
|
inline |
Writes a single byte to the stream
value | The byte to add to the stream. |
NotSupportedException | If this stream is not writeable. |
ObjectDisposedException | If this stream has been disposed. |
Definition at line 226 of file GZipStream.cs.
References DotZLib.GZipStream._gzFile, DotZLib.GZipStream._isDisposed, DotZLib.GZipStream.CanWrite, DotZLib.GZipStream.gzputc(), and value.
|
private |
Definition at line 41 of file GZipStream.cs.
Referenced by DotZLib.GZipStream.cleanUp(), DotZLib.GZipStream.GZipStream(), DotZLib.GZipStream.Read(), DotZLib.GZipStream.ReadByte(), DotZLib.GZipStream.Write(), and DotZLib.GZipStream.WriteByte().
Definition at line 42 of file GZipStream.cs.
Referenced by DotZLib.GZipStream.cleanUp(), DotZLib.GZipStream.Read(), DotZLib.GZipStream.ReadByte(), DotZLib.GZipStream.Write(), and DotZLib.GZipStream.WriteByte().
|
private |
Definition at line 43 of file GZipStream.cs.
Referenced by DotZLib.GZipStream.GZipStream().
|
get |
Returns true of this stream can be read from, false otherwise
Definition at line 80 of file GZipStream.cs.
Referenced by DotZLib.GZipStream.Read(), and DotZLib.GZipStream.ReadByte().
|
get |
Returns false.
Definition at line 92 of file GZipStream.cs.
|
get |
Returns true if this tsream is writeable, false otherwise
Definition at line 103 of file GZipStream.cs.
Referenced by DotZLib.GZipStream.Write(), and DotZLib.GZipStream.WriteByte().
|
get |
Gets the size of the stream. Not suppported.
In this implementation this property is not supported
NotSupportedException | Always thrown |
Definition at line 292 of file GZipStream.cs.
|
getset |
Gets/sets the current position in the GZipStream
. Not suppported.
In this implementation this property is not supported
NotSupportedException | Always thrown |
Definition at line 275 of file GZipStream.cs.