         return result
     }
 
-    private static func processStream(_ pointerData: DataWithPointer) throws -> Data {
+    private static func processStream(_ pointerData: DataWithPointer) throws -> (data: Data, checkError: Bool) {
         var out = Data()
 
         let streamHeader = try XZStreamHeader(pointerData)


        var result = [Data]()
        streamLoop: while !pointerData.isAtTheEnd {
            result.append(try processStream(pointerData))

            guard !pointerData.isAtTheEnd else { break streamLoop }



        var result = Data()
        streamLoop: while !pointerData.isAtTheEnd {
            let streamResult = try processStream(pointerData)
            if streamResult.checkError {
                throw XZError.wrongCheck([result])
            } else {
                result.append(streamResult.data)
            }

            guard !pointerData.isAtTheEnd else { break streamLoop }

