Git Product home page Git Product logo

Comments (4)

yfakariya avatar yfakariya commented on July 18, 2024

MsgPack-CLI might not work on .NET Micro Framework because MsgPack.Serialization APIs depend on dynamic code generation via System.Reflection.Emit or expression tree.
I don't know any alternative libraries, but Packer/Unpacker primitive APIs in msgpack-cli might help you to create or interpret msgpack stream. It is not very convenience, but it might work.

from msgpack-cli.

fdb-git avatar fdb-git commented on July 18, 2024

Ok, thak you so much, Yusuke.
Bye.

from msgpack-cli.

fdb-git avatar fdb-git commented on July 18, 2024

I didn't found what are the classes that implement the serialization of Map and Array.

I found the class MsgPack takes care of serializing simple data, but could not find where is the basic serialization of Map and Array

from msgpack-cli.

yfakariya avatar yfakariya commented on July 18, 2024

You can do that with Packer API. There are 2 steps to make array or map.

  1. Write a header value which represents items count of the array or the map via PackArrayHeader or PackMapHeader respectedly.
  2. Write a body via Pack methods for each items in the array or the map. Note that you just pack items as non-collection items.

Example:

// Array
List<int> items = ...;
Packer packer = ...;
packer.PackArrayHeader(items); // or, just write packer.PackArrayHeader(items.Count)
foreach( var item in items) 
{
    packer.Pack(item);
}

// Map
Dictionary<string, int> items = ...;
Packer packer = ...;
packer.PackMapHeader(items); // or, just write packer.PackMapHeader(items.Count)
foreach( var item in items) 
{
    packer.PackString(item.Key);
    packer.Pack(item.Value);
}

from msgpack-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.