Questions tagged [serialization]

Serialization is the process by which an object is converted into a format that can be stored and later retrieved.

28 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
146 views

Reading sparse matrix from binary file

I have binary files containing sparse matrices. Their format is: number of rows int length of a row int column index int value float Reading ...
5
votes
0answers
139 views

C++ string Formatter Again Part-4

Previously asked here. The code is now available on GitHub. Since the previous review I have added unit tests. Since it is big it will come in a couple of parts. Part 1 | Part 2 | Part 3 | Part 4 ...
4
votes
1answer
78 views

How to properly decode a JSON dictionary into different Swift classes using Decodable and JSONDecoder?

Generally, the approach I've taken is to try calling container.decode from a decodable enum with its associated value returning ...
4
votes
0answers
106 views

(de-)serializer for arbitrary python objects

My program is intended to allow (de-)serialization of arbitrary Python objects. It's basically a replacement for python's pickle module, which is similar but prone ...
3
votes
0answers
602 views

C# Rest Client Benchmarking

I build a C# Rest Client library / framework. I noticed that it seemed to be significantly faster than RestSharp for GET at least. So, I decided to put together some benchmarks comparing it to other ...
3
votes
0answers
151 views

F# XML Generation in .NET Core: XmlSerializer or XmlProvider

I am working on SEPA XML generator in F#. I developed two solutions that are roughly equivalent, one relies on the XmlSerializer while the other relies on ...
3
votes
0answers
270 views

Java code to convert BigDecimal to/from .NET decimal

Background In many languages we have built-in data types for representing decimal floating point numbers. In .NET that's decimal, and in Java we have ...
3
votes
0answers
713 views

Implementing a JSON-serializable ORM model

I implemented a library which, amongst other things, implements a JSON-serializable ORM model based on the peewee framework. Here's the relevant excerpt: ...
3
votes
0answers
133 views

Trait class for a serialization framework

In a current project I have implemented a small non-intrusive serialization framework based on type traits. The generic trait template looks like this: ...
3
votes
0answers
322 views

Functionally Typed I/O Streams

I thought up a function that provides types with InputStream and OutputStream: ...
2
votes
0answers
267 views

WebAPI: Async Filtering CSV content + Json/XML Serialization

I am coding a csv file filtering api in ASP.NET Core, which takes a csv file located at a given uri (and retrieved via the query string) convert the content to a collection of records, then apply a ...
2
votes
0answers
57 views

Whole Packet Protocol Communication Library in Node

I have built this small class as a small library to be able to talk to a server that uses CapeSoft's NetTalk library as socket library, and which uses the Whole Packet Protocol, which is a simple ...
2
votes
0answers
296 views

Ruby Hash to XML

I've just made this "serialization" module in Ruby that takes a hash and outputs a XML string. ...
2
votes
0answers
217 views

Library for manipulation of binary protocol headers

I'm starting with implementing a TCP/IP stack for embedded systems which will be done in C++ and I've found I need a good way to work with protocol headers involved (e.g. ARP, IP, TCP). Major ...
2
votes
0answers
233 views

Binary protocol variability V3.0

Summary: Parsing an incoming stream of events from a binary communication protocol, if we have some variations in devices to support and would not like to have one huge switch to include everything. ...
2
votes
0answers
2k views

Reusable REST service class for Angular2 in TypeScript

I am creating an Angular 2 web application using TypeScript. This application performs REST requests to a REST "service". For each REST resource in my service I create a separate "Service" class in ...
2
votes
0answers
275 views

Better way to deep copy than this? How can I make it generic by `Collection` type?

Could I make this method for deep copy generic to the Collection type? That method is so simple and I can't imagine ever needing to change it, so maybe I should ...
2
votes
0answers
455 views

Serialize/deserialize a vector using insertion/extraction operators

I've never serialized a structure to a file before in C++, so I'm looking for critique on my first try at it. My main concerns are: It uses the streams space-delimited behavior. If a ...
2
votes
0answers
2k views

Serializing and deserializing objects in Java

I have a class that receives an Object object as a parameter. Then, I want to write two functions to serialize, and ...
1
vote
0answers
22 views

Custom JsonConverter for class

Note that this is about System.Text.Json, not NewtonSoft. The underlying issue that inspired this example is the problem of using different serialization on a particular property of a particular class ...
1
vote
0answers
70 views

Better way to Read /Write Memory<byte> to/from POCO

I am communicating with a machine that sends/received structured binary data to my netcore service. The machine supplier's new library uses Memory in their library's API. I have written the following ...
1
vote
0answers
828 views

A simple and efficient packet frame encoder/decoder

I have written a simple packet-framing class, for converting un-encoded 'packets' into encoded/delimited 'frames,' to be sent over a P2P serial connection. The functionality is based on the RFC 1662 "...
1
vote
0answers
50 views

Class that pickles, unpickles and extends pickled documents

I've been pickling ngram models and I wrote this class to be able to easily extend models when training. I wanted to know if it could possibly be done in a better way? ...
1
vote
0answers
466 views

Save protobuf-net serialized data with variable length to a file

My program gets continuously raw input from a stream (TCP), then process the data and output the data to a graph. It should also save the data to a file so it can be read afterwards. To archive this I ...
1
vote
0answers
225 views

A tiny library that implements bencoding (simple data encoding format)

Here are three files that make my library that implements a quite simple data encoding. What improvements would you suggest? README.md ...
1
vote
0answers
249 views

.NET List Serializer design

A few weeks back I wrote a class to help serialize/deserialize objects file. The file format requested was json, then compressed. After some coding/testing I settled on this design: ...
1
vote
0answers
165 views

Saving the state of a ViewModel

I've the following scenario, I've got some viewmodel that need to persist their state on disk. I've defined a custom attribute as: ...
0
votes
1answer
44 views

Unity Static Singleton JSON Serialisation

I have a static PlayerData singleton which stores all the data for the player (gold, upgrades, heroes etc) but JsonUtility ...