         return Data(bytes: out)
     }
 
-    private static func processStreamHeader(_ pointerData: DataWithPointer) throws
-        -> (checkType: CheckType, flagsCRC: UInt32) {
-        // Check magic number.
-        guard pointerData.bytes(count: 6) == [0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00]
-            else { throw XZError.wrongMagic }
-
-        let flagsBytes = pointerData.bytes(count: 2)
-
-        // First, we need to check for corruption in flags,
-        //  so we compare CRC32 of flags to the value stored in archive.
-        let flagsCRC = pointerData.uint32()
-        guard CheckSums.crc32(flagsBytes) == flagsCRC
-            else { throw XZError.wrongInfoCRC }
-
-        // If data is not corrupted, then some bits must be equal to zero.
-        guard flagsBytes[0] == 0 && flagsBytes[1] & 0xF0 == 0
-            else { throw XZError.fieldReservedValue }
-
-        // Four bits of second flags byte indicate type of redundancy check.
-        guard let checkType = CheckType(rawValue: flagsBytes[1].toInt() & 0xF)
-            else { throw XZError.fieldReservedValue }
-
-        return (checkType, flagsCRC)
-    }
-
     private static func processBlock(_ blockHeaderSize: Int, _ pointerData: DataWithPointer) throws -> Block {
         let blockHeaderStartIndex = pointerData.index - 1
         guard blockHeaderSize >= 0x01 && blockHeaderSize <= 0xFF

/// Provides unarchive function for XZ archives.
public class XZArchive: Archive {

    enum CheckType: Int {
        case none = 0x00
        case crc32 = 0x01
        case crc64 = 0x04
        case sha256 = 0x0A
    }

    private struct Block {

        let bytes: [UInt8]

        return indexSize + 4
    }

    private static func processFooter(_ streamHeader: XZStreamHeader, _ indexSize: Int,
                                      _ pointerData: DataWithPointer) throws {
        let footerCRC = pointerData.uint32()
        /// Indicates the size of Index field. Should match its real size.
