      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 bldCodes = Deflate.lengthEncode(data)
 
         // 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.
+        let uncompBlockSize = 1 + 2 + 2 + data.count // Header, length, n-length and data.
 
         // Static Huffman size is more complicated...
         let staticHuffmanBlockSize = staticHuffmanBitSize(bldCodes.stats)

        return bitsCount % 8 == 0 ? bitsCount / 8 : bitsCount / 8 + 1
    }

    private static func createUncompressedBlock(_ bytes: [UInt8]) -> [UInt8] {
        let bitWriter = BitWriter(bitOrder: .reversed)

        // Write block header.


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