             longName = nil
             longLinkName = nil
         }
+        // Parsing must complete at the end of a 512 byte-long block.
+        assert(reader.bytesRead % 512 == 0)
         return info
     }
 

            else { return nil }

        let header = try TarHeader(reader)
        let info = TarEntryInfo(header, lastGlobalExtendedHeader, lastLocalExtendedHeader, longName, longLinkName)
        let dataStartIndex = header.blockStartIndex + 512

        if case .special(let specialEntryType) = header.type {

import BitByteData

// While it is tempting to make Provider conform to `IteratorProtocol` and `Sequence` protocols, it is in fact
// impossible to do so, since `TarHeader.init(...)` is throwing and `IteratorProtocol.next()` cannot be throwing.
struct TarEntryInfoProvider {

    private let reader: LittleEndianByteReader
