We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible fix approved by @mredlin
/// Consume bytes from stream, return unpacked file /// /// - parameter data: data to consume /// /// - throws: TarFile.Errors /// /// - returns: tuple with filename and data on completion of a single file open func consume(data: [CChar]) throws -> (filename: String, data: Data)? { if !self.streamingMode { throw Errors.programmingError } return try self.buffer.withUnsafeBufferPointer { bufferPointer in guard let pointer = bufferPointer.baseAddress else { throw Errors.programmingError } if bufferPointer.count > 512 { let header = try self.parse(header: pointer) let endOffset = 512 + (header.filesize + (512 - header.filesize % 512)) if bufferPointer.count > endOffset { let data = Data(bytes: pointer.advanced(by: 512), count: header.filesize) self.buffer.removeFirst(endOffset) if header.isFile { return (filename: header.filepath, data:data) } } } return nil } }
The text was updated successfully, but these errors were encountered:
I am not up to date on recent swift changes, taking myself out of assignees
Sorry, something went wrong.
mredlin
No branches or pull requests
Possible fix approved by @mredlin
The text was updated successfully, but these errors were encountered: