         assert(headerData.count == 512)
 
         let header = try TarHeader(LittleEndianByteReader(data: headerData))
-        // Since we read input in 512 bytes-long chunks, we don't have to check that we processed at most 512 bytes.
+        // Since we explicitly initialize the header from 512 bytes-long Data, we don't have to check that we processed
+        // at most 512 bytes.
         // Check, just in case, since we use blockStartIndex = -1 when creating TAR containers.
         assert(header.blockStartIndex >= 0)
+        let dataStartOffset = try getOffset()
 
         let entryData = try getData(size: header.size)
-        // Since we read input in 512 bytes-long chunks we don't have to round up the size as we do in TarParser.
         if case .special(let specialEntryType) = header.type {
             switch specialEntryType {
             case .globalExtendedHeader:

    }

    public mutating func next() throws -> TarEntry? {
        let headerData = try getChunk()
        if headerData.count == 0 {
            return nil
        } else if headerData == Data(count: 512) {
            // EOF marker case.
            let offset: UInt64
            if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
                offset = try handle.offset()
            } else {
                offset = handle.offsetInFile
            }
            if try getChunk() == Data(count: 512) {
                return nil
            } else {
                if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
                    try handle.seek(toOffset: offset)
                } else {
                    handle.seek(toFileOffset: offset)
                }
            }
        } else if headerData.count < 512 {
            throw DataError.truncated

        }
    }

    private func getOffset() throws -> UInt64 {
        let offset: UInt64
        if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
            offset = try handle.offset()
        } else {
            offset = handle.offsetInFile
        }
        return offset
    }

    private func set(offset: UInt64) throws {
        if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
            try handle.seek(toOffset: offset)
        } else {
            handle.seek(toFileOffset: offset)
        }
    }

    private func getData(size: Int) throws -> Data {
        assert(size >= 0, "TarReader.getData(size:): negative size.")
        guard size > 0
            else { return Data() }
        let out: Data
        if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
            guard let chunkData = try handle.read(upToCount: size)
                else { throw DataError.truncated }
            out = chunkData
        } else {
            // Technically, this can throw NSException, but since it is ObjC exception we cannot handle it in Swift.
            out = handle.readData(ofLength: size)
        }
        return out
    }

}
