3 package SevenZip.Compression.LZ;
5 import java.io.IOException;
13 java.io.OutputStream _stream;
15 public void Create(int windowSize)
17 if (_buffer == null || _windowSize != windowSize)
18 _buffer = new byte[windowSize];
19 _windowSize = windowSize;
24 public void SetStream(java.io.OutputStream stream) throws IOException
30 public void ReleaseStream() throws IOException
36 public void Init(boolean solid)
45 public void Flush() throws IOException
47 int size = _pos - _streamPos;
50 _stream.write(_buffer, _streamPos, size);
51 if (_pos >= _windowSize)
56 public void CopyBlock(int distance, int len) throws IOException
58 int pos = _pos - distance - 1;
61 for (; len != 0; len--)
63 if (pos >= _windowSize)
65 _buffer[_pos++] = _buffer[pos++];
66 if (_pos >= _windowSize)
71 public void PutByte(byte b) throws IOException
74 if (_pos >= _windowSize)
78 public byte GetByte(int distance)
80 int pos = _pos - distance - 1;