Skip to content

eonist/FileStreamer

Repository files navigation

Lang mit Tests

FileStreamer

Continuous data to disk

Installation:

  • SPM "https://github.com/light-stream/FileStreamer.git" branch: "master"

Writer example:

let filePath: String = NSString(string: "~/Desktop/del.txt").expandingTildeInPath
guard let data: Data = ("black dog" as NSString).data(using: String.Encoding.utf8.rawValue) else {Swift.print("unable to create data");return}
FSWriter.write(url: URL(filePath), data: data, index: 0)

Reader example:

let filePath: String = NSString(string: "~/Desktop/del.txt").expandingTildeInPath
let data: Data = FSReader.read(filePath: filePath, startIndex: 50, endIndex: 100)
Swift.print("\(String(data: data, encoding: .utf8))") // blalbslalballabalbla...

Size example:

let fileSize = FSReader.fileSize(filePath: filePath)

Releases

No releases published

Packages

No packages published

Languages