3 namespace SevenZip
.Compression
.LZ
11 System
.IO
.Stream _stream
;
13 public void Create(uint windowSize
)
15 if (_windowSize
!= windowSize
)
17 // System.GC.Collect();
18 _buffer
= new byte[windowSize
];
20 _windowSize
= windowSize
;
25 public void Init(System
.IO
.Stream stream
, bool solid
)
36 public void Init(System
.IO
.Stream stream
) { Init(stream, false); }
38 public void ReleaseStream()
46 uint size
= _pos
- _streamPos
;
49 _stream
.Write(_buffer
, (int)_streamPos
, (int)size
);
50 if (_pos
>= _windowSize
)
55 public void CopyBlock(uint distance
, uint len
)
57 uint pos
= _pos
- distance
- 1;
58 if (pos
>= _windowSize
)
60 for (; len
> 0; len
--)
62 if (pos
>= _windowSize
)
64 _buffer
[_pos
++] = _buffer
[pos
++];
65 if (_pos
>= _windowSize
)
70 public void PutByte(byte b
)
73 if (_pos
>= _windowSize
)
77 public byte GetByte(uint distance
)
79 uint pos
= _pos
- distance
- 1;
80 if (pos
>= _windowSize
)