搜尋套件、儲存庫與 APP 分類

套件詳情v25.9.23

flat_buffers

用於 Dart 的 FlatBuffers 讀寫程式庫。基於 Dart SDK 團隊的 Konstantin Scheglov 與 Paul Berry 的原始作品。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
27.7萬
喜歡數
45
Pub 分數
140

安裝套件

flutter pub add flat_buffers

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個用於讀取和寫入 FlatBuffers(一種高效率序列化格式)的 Dart 庫。它能讓系統之間有效交換資料,記憶體開銷極小,無需解析或複製資料。基於 Dart SDK 團隊的 Konstantin Scheglov 與 Paul Berry 的原始工作,支援跨平台使用,涵蓋 Android、iOS、Web、macOS、Windows 與 Linux。適合需要快速、緊湊資料序列化的應用,例如遊戲、即時系統與行動應用。

適用情境

  • 高效能資料序列化
  • 跨平台資料交換
  • 遊戲開發
  • 即時資料處理
  • 行動應用程式資料儲存
  • 嵌入式系統

主要特色

  • 零複製反序列化
  • 最小記憶體使用
  • 跨平台相容性
  • 快速讀寫操作
  • 支援架構定義
  • 從 .fbs 檔案產生的程式碼

適合對象

  • 效能關鍵的應用程式
  • 需要快速資料存取的行動與Web應用程式
  • 遊戲與模擬
  • 資料密集型後端服務
  • 記憶體資源有限的系統

使用建議

  • 需要架構定義(.fbs 檔案)
  • 新使用者的學習曲線
  • 有限的可讀輸出
  • 由於二進位格式,不太適合除錯
  • 需要程式碼產生步驟

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

logo FlatBuffers

Build status BuildKite status Fuzzing Status Discord Chat Twitter Follow Twitter Follow

FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.

Quick Start

  1. Build the compiler for flatbuffers (flatc)

    Use cmake to create the build files for your platform and then perform the compilation (Linux example).

    cmake -G "Unix Makefiles"
    make -j
    
  2. Define your flatbuffer schema (.fbs)

    Write the schema to define the data you want to serialize. See monster.fbs for an example.

  3. Generate code for your language(s)

    Use the flatc compiler to take your schema and generate language-specific code:

    ./flatc --cpp --rust monster.fbs
    

    Which generates monster_generated.h and monster_generated.rs files.

  4. Serialize data

    Use the generated code, as well as the FlatBufferBuilder to construct your serialized buffer. (C++ example)

  5. Transmit/store/save Buffer

    Use your serialized buffer however you want. Send it to someone, save it for later, etc...

  6. Read the data

    Use the generated accessors to read the data from the serialized buffer.

    It doesn't need to be the same language/schema version, FlatBuffers ensures the data is readable across languages and schema versions. See the Rust example reading the data written by C++.

Documentation

Go to our landing page to browse our documentation.

Supported operating systems

  • Windows
  • macOS
  • Linux
  • Android
  • And any others with a recent C++ compiler (C++ 11 and newer)

Supported programming languages

Code generation and runtime libraries for many popular languages.

  1. C
  2. C++ - snapcraft.io
  3. C# - nuget.org
  4. Dart - pub.dev
  5. Go - go.dev
  6. Java - Maven
  7. JavaScript - NPM
  8. Kotlin
  9. Lobster
  10. Lua
  11. PHP
  12. Python - PyPI
  13. Rust - crates.io
  14. Swift - swiftpackageindex
  15. TypeScript - NPM
  16. Nim

Versioning

FlatBuffers does not follow traditional SemVer versioning (see rationale) but rather uses a format of the date of the release.

Contribution

To contribute to this project, see CONTRIBUTING.

Community

Security

Please see our Security Policy for reporting vulnerabilities.

Licensing

Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.


所屬分類

原始碼儲存庫

使用此套件的專案