 
                 // Again, the distance cannot be greater than 32768.
                 if distance <= 32768 {
-                    while inputIndex + matchLength < rawBytes.count &&
-                        rawBytes[inputIndex + matchLength] == rawBytes[repeatIndex] && matchLength < 258 {
+                    while inputIndex + matchLength < data.count &&
+                        data[inputIndex + matchLength] == data[repeatIndex] && matchLength < 258 {
                             matchLength += 1
                             repeatIndex += 1
                             if repeatIndex > inputIndex {

     then static Huffman block will be created.
     */
    public static func compress(data: Data) -> Data {
        let bytes = data.toArray(type: UInt8.self)

        let bldCodes = Deflate.lengthEncode(bytes)

        // Let's count possible sizes according to statistics.

        // Uncompressed block size calculation is simple:
        let uncompBlockSize = 1 + 2 + 2 + bytes.count // Header, length, n-length and data.

        // Static Huffman size is more complicated...
        let staticHuffmanBlockSize = staticHuffmanBitSize(bldCodes.stats)

        bitWriter.finish()

        // Write data's length.
        bitWriter.write(number: data.count, bitsCount: 16)
        // Write data's n-length.
        bitWriter.write(number: data.count ^ (1 << 16 - 1), bitsCount: 16)

        var out = Data(bytes: bitWriter.buffer)
        out.append(data)

        return out
    }
