目录
目录README.md

Binary Coder for Swift

Build Docs

A simple Encoder and Decoder that serializes Codable Swift types to a flat, untagged binary representation. Note that this usually requires the structures to have a fixed size.

Example

struct Point: Codable {
    let x: UInt16
    let y: UInt16
}

let encoder = BinaryEncoder()
try encoder.encode(Point(x: 2, y: 3))
// -> Data([0, 2, 0, 3])

let decoder = BinaryDecoder()
try decoder.decode(Point.self, from: Data([0, 2, 0, 3]))
// -> Point(x: 2, y: 3)
关于
88.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号