RLib  5.7
RLib - an opensource, lightweight and multi-platform framework for cpp programming
System::IO::Compression::CompressionStream Class Reference

Provides methods and properties used to compress and decompress streams More...

Inheritance diagram for System::IO::Compression::CompressionStream:
System::IO::Stream System::IO::Compression::DeflateStream System::IO::Compression::GZipStream

Public Member Functions

bool GetCanRead () const
 Gets a value indicating whether the stream supports reading while decompressing More...
 
 RLIB_PROPERTY_GET (bool CanRead, GetCanRead)
 Gets a value indicating whether the stream supports reading while decompressing More...
 
StreamGetBaseStream ()
 Gets a reference to the underlying stream More...
 
 RLIB_PROPERTY_GET (Stream *BaseStream, GetBaseStream)
 Gets a reference to the underlying stream More...
 
virtual intptr_t Read (LPVOID buffer, intptr_t count) const override
 Reads a number of decompressed bytes into the specified byte array More...
 
virtual intptr_t Write (LPCVOID data, intptr_t count) override
 Writes compressed bytes to the underlying stream from the specified byte array More...
 
virtual void Flush () override
 Flushs any pending output to the underlying stream No action is performed when using decompress mode More...
 
virtual void Close () override
 Closes the current stream and releases any resources associated with the current stream More...
 
virtual bool InheritFromMemoryStream () const overridefinal
 指示当前实例是否继承自 MemoryStream More...
 
virtual bool InheritFromBufferedStream () const overridefinal
 指示当前实例是否继承自 BufferedStream More...
 
- Public Member Functions inherited from System::IO::Stream
 RLIB_PROPERTY_GET_SET (intptr_t Position, GetPos, SetPos)
 When overridden in a derived class, gets or sets the position within the current stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Size, GetSize, SetSize)
 When overridden in a derived class, gets or sets the capacity in bytes of the stream More...
 
 RLIB_PROPERTY_GET_SET (intptr_t Length, GetLength, SetLength)
 When overridden in a derived class, gets or sets the length in bytes of the stream More...
 
intptr_t GetMaxReadSize () const
 Gets the maximum bytes of readable data from current position More...
 
 RLIB_PROPERTY_GET (intptr_t MaxReadSize, GetMaxReadSize)
 Gets the maximum bytes of readable data from current position More...
 
intptr_t GetMaxWriteSize () const
 Gets the maximum writeable bytes from current position, based on current capacity More...
 
 RLIB_PROPERTY_GET (intptr_t MaxWriteSize, GetMaxWriteSize)
 Gets the maximum writeable bytes from current position, based on current capacity More...
 
void CopyTo (Stream *destination, intptr_t bufferSize=RLIB_DEFAULT_BUFFER_SIZE) const
 Reads the bytes from the current stream and writes them to another stream, using a specified buffer size More...
 

Protected Member Functions

 CompressionStream (Stream *stream, CompressionMode mode)
 

Protected Attributes

unsigned char * m_buffer
 
Streamm_underlying_stream
 
CompressionMode m_mode
 
char m_external_struct [14 *sizeof(intptr_t)]
 
bool m_gzip_header_flag
 
 RLIB_DECLARE_DYNCREATE
 

Detailed Description

Provides methods and properties used to compress and decompress streams

Member Function Documentation

void CompressionStream::Close ( )
overridevirtual

Closes the current stream and releases any resources associated with the current stream

Warning
This function discards any unprocessed input and does not flush any pending output

Implements System::IO::Stream.

void CompressionStream::Flush ( )
overridevirtual

Flushs any pending output to the underlying stream No action is performed when using decompress mode

Implements System::IO::Stream.

Stream* System::IO::Compression::CompressionStream::GetBaseStream ( )
inline

Gets a reference to the underlying stream

bool System::IO::Compression::CompressionStream::GetCanRead ( ) const
inline

Gets a value indicating whether the stream supports reading while decompressing

virtual bool System::IO::Compression::CompressionStream::InheritFromBufferedStream ( ) const
inlinefinaloverridevirtual

指示当前实例是否继承自 BufferedStream

Implements System::IO::Stream.

virtual bool System::IO::Compression::CompressionStream::InheritFromMemoryStream ( ) const
inlinefinaloverridevirtual

指示当前实例是否继承自 MemoryStream

Implements System::IO::Stream.

intptr_t CompressionStream::Read ( LPVOID  buffer,
intptr_t  count 
) const
overridevirtual

Reads a number of decompressed bytes into the specified byte array

Implements System::IO::Stream.

System::IO::Compression::CompressionStream::RLIB_PROPERTY_GET ( bool  CanRead,
GetCanRead   
)

Gets a value indicating whether the stream supports reading while decompressing

System::IO::Compression::CompressionStream::RLIB_PROPERTY_GET ( Stream BaseStream,
GetBaseStream   
)

Gets a reference to the underlying stream

intptr_t CompressionStream::Write ( LPCVOID  data,
intptr_t  count 
)
overridevirtual

Writes compressed bytes to the underlying stream from the specified byte array

Returns
the total output count to the underlying stream currently, or -1 if failed

Implements System::IO::Stream.


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