-DeflatedInputStream( InputStream& istream )
- : m_istream( istream ){
- m_zipstream.zalloc = 0;
- m_zipstream.zfree = 0;
- m_zipstream.opaque = 0;
- m_zipstream.avail_in = 0;
- inflateInit2( &m_zipstream, -MAX_WBITS );
-}
-~DeflatedInputStream(){
- inflateEnd( &m_zipstream );
-}
-size_type read( byte_type* buffer, size_type length ){
- m_zipstream.next_out = buffer;
- m_zipstream.avail_out = static_cast<uInt>( length );
- while ( m_zipstream.avail_out != 0 )
- {
- if ( m_zipstream.avail_in == 0 ) {
- m_zipstream.next_in = m_buffer;
- m_zipstream.avail_in = static_cast<uInt>( m_istream.read( m_buffer, m_bufsize ) );
- }
- if ( inflate( &m_zipstream, Z_SYNC_FLUSH ) != Z_OK ) {
- break;
- }
- }
- return length - m_zipstream.avail_out;
-}
+ DeflatedInputStream(InputStream &istream)
+ : m_istream(istream)
+ {
+ m_zipstream.zalloc = 0;
+ m_zipstream.zfree = 0;
+ m_zipstream.opaque = 0;
+ m_zipstream.avail_in = 0;
+ inflateInit2(&m_zipstream, -MAX_WBITS);
+ }
+
+ ~DeflatedInputStream()
+ {
+ inflateEnd(&m_zipstream);
+ }
+
+ size_type read(byte_type *buffer, size_type length)
+ {
+ m_zipstream.next_out = buffer;
+ m_zipstream.avail_out = static_cast<uInt>( length );
+ while (m_zipstream.avail_out != 0) {
+ if (m_zipstream.avail_in == 0) {
+ m_zipstream.next_in = m_buffer;
+ m_zipstream.avail_in = static_cast<uInt>( m_istream.read(m_buffer, m_bufsize));
+ }
+ if (inflate(&m_zipstream, Z_SYNC_FLUSH) != Z_OK) {
+ break;
+ }
+ }
+ return length - m_zipstream.avail_out;
+ }