public FlushBlock ( byte stored, int storedOffset, int storedLength, bool lastBlock ) : void | ||
stored | byte | Data to flush |
storedOffset | int | Index of first byte to flush |
storedLength | int | Count of bytes to flush |
lastBlock | bool | True if this is the last block |
Résultat | void |
public void SetLevel(int lvl) { goodLength = DeflaterConstants.GOOD_LENGTH[lvl]; max_lazy = DeflaterConstants.MAX_LAZY[lvl]; niceLength = DeflaterConstants.NICE_LENGTH[lvl]; max_chain = DeflaterConstants.MAX_CHAIN[lvl]; if (DeflaterConstants.COMPR_FUNC[lvl] != comprFunc) { // if (DeflaterConstants.DEBUGGING) { // //Console.WriteLine("Change from "+comprFunc +" to " // + DeflaterConstants.COMPR_FUNC[lvl]); // } switch (comprFunc) { case DEFLATE_STORED: if (strstart > blockStart) { huffman.FlushStoredBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } UpdateHash(); break; case DEFLATE_FAST: if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } break; case DEFLATE_SLOW: if (prevAvailable) { huffman.TallyLit(window[strstart - 1] & 0xff); } if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, false); blockStart = strstart; } prevAvailable = false; matchLen = MIN_MATCH - 1; break; } comprFunc = COMPR_FUNC[lvl]; } }
public void SetLevel(int level) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (level < 0 || level > 9) { throw new ArgumentOutOfRangeException("level"); } goodLength = DeflaterConstants.GOOD_LENGTH[level]; max_lazy = DeflaterConstants.MAX_LAZY[level]; niceLength = DeflaterConstants.NICE_LENGTH[level]; max_chain = DeflaterConstants.MAX_CHAIN[level]; if (DeflaterConstants.COMPR_FUNC[level] == compressionFunction) { return; } switch (compressionFunction) { case 0: if (strstart > blockStart) { huffman.FlushStoredBlock(window, blockStart, strstart - blockStart, lastBlock: false); blockStart = strstart; } UpdateHash(); break; case 1: if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock: false); blockStart = strstart; } break; case 2: if (prevAvailable) { huffman.TallyLit(window[strstart - 1] & 0xFF); } if (strstart > blockStart) { huffman.FlushBlock(window, blockStart, strstart - blockStart, lastBlock: false); blockStart = strstart; } prevAvailable = false; matchLen = 2; break; } compressionFunction = DeflaterConstants.COMPR_FUNC[level]; }