public SetDictionary ( byte buffer, int offset, int length ) : void | ||
buffer | byte | The buffer containing the dictionary data |
offset | int | The offset in the buffer for the first byte of data |
length | int | The length of the dictionary data. |
return | void |
public void SetDictionary(byte[] buffer, int offset, int length)
{
#if DebugDeflation
if (DeflaterConstants.DEBUGGING && (strstart != 1) )
{
throw new InvalidOperationException("strstart not 1");
}
#endif
adler.Update(buffer, offset, length);
if (length < DeflaterConstants.MIN_MATCH) {
return;
}
if (length > DeflaterConstants.MAX_DIST) {
offset += length - DeflaterConstants.MAX_DIST;
length = DeflaterConstants.MAX_DIST;
}
System.Array.Copy(buffer, offset, window, strstart, length);
UpdateHash();
--length;
while (--length > 0) {
InsertString();
strstart++;
}
strstart += 2;
blockStart = strstart;
}
public void SetDictionary(byte[] dictionary, int index, int count) { if (state != 0) { throw new InvalidOperationException(); } state = 1; engine.SetDictionary(dictionary, index, count); }