Skip to content

Instantly share code, notes, and snippets.

Created Jan 31, 2021
What would you like to do?
func read(byteRange: CountableRange<Int>, queue: DispatchQueue = .main, completionHandler: @escaping (DispatchData?) -> Void) {
if let channel = channel { off_t(byteRange.startIndex), length: byteRange.count, queue: queue, ioHandler: { done, data, error in
print(done, data?.count ?? -1, error)
else {
print("Channel is closed")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment