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

learn more… | top users | synonyms

1
vote
3answers
38 views

Byte array to floating point such as FPE2 in Java

Apple's System Management Controller uses FPE2 and SP78 as floating-point formats. While writing a Java library that that interfaces with the SMC, I ported someone's C function to convert read a ...
1
vote
1answer
51 views

XSD Schema for optical media

I recently wrote my first XSD Schema: ...
6
votes
0answers
46 views

Data marshaling wrapper for a TCP server

After a lot of research, I created this wrapper which I think fits very well to my needs. My project is a TCP server and I will be using this wrapper every time the server receives a packet. ...
2
votes
2answers
58 views

Generated serialization code

CGbR project I am currently working on a project that generates code from classes. The idea is to achieve maximum performance by replacing reflection use cases with fast, generated code. Current ...
3
votes
1answer
42 views

Something to store any (standard) data in python

I decided to try make my own way to save normal python data yesterday after coming across the minecraft NBT format, it's more limited than cPickle but appears to produce shorter results and so far ...
0
votes
1answer
57 views

Create Xml to string serializer

I don't want to serialize everything. I created a custom attribute DoNotSerializeAttribute. If some property in info contain ...
1
vote
1answer
43 views

Object parser in C++

Consider the following contrived data type: Building: int age, char* location, float ...
1
vote
0answers
96 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: ...
3
votes
1answer
43 views

Vigenère cipher as an IO filter

I implemented a Vigenere encoding and decoding class. Ideally, the program should be able to take any abritrary file, read into an array of byte, and decode it. ...
2
votes
1answer
96 views

A Dynamic CSV Serializer

I made a dynamic CSV serializer as a learning challenge a while back, I'm hoping to get my code picked apart so I can learn what I can do better. This is a bit long, so I wouldn't expect anyone to ...
6
votes
1answer
84 views

Reading bytes from packet

I have a device I connect to on TCP socket. I send it a message with what I want and it sends back all sorts of useful information: Header: ...
1
vote
0answers
384 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 ...
0
votes
1answer
46 views

Reading many kinds of numbers from a byte buffer

I've been trying to find a way to collapse all these methods into one. Current I have these methods ...
5
votes
1answer
52 views

Polymorphic TLV serialization

Inspired by this question I decided to write an alternative that uses polymorhphism and a Factory pattern. The code works for the subset of implemented types, namely ...
6
votes
1answer
227 views

TLV implementation in C++

I tried implementing TLV(https://en.wikipedia.org/wiki/Type-length-value). Actually my implementation is more than TLV because it supports additional "Tag" elements (which you can use for naming ...
5
votes
2answers
524 views

Type to byte array conversion in Swift

I need the byte representation of a given type, especially double, float, int8, etc. ...
7
votes
2answers
57 views

Querying Facebook for details of a user's OAuth token

This class exposes the public method getAuthToken which takes a user's Facebook OAuth token as an input parameter and queries Facebook for information about it - ...
7
votes
2answers
73 views

Updating resources while avoiding race conditions

I am writing a utility class for a game client. This class has two main functions: connect to a game server and retrieve the current game revision, and retrieve a "recipe", which is basically ...
5
votes
3answers
60 views

Advanced formatting with argument passing

I want to customise how my objects are printed using the .format() function. I have two problems to make that happen in clear and concise way. But since the second ...
4
votes
3answers
568 views

Format of hexeditor

Is there a cleaner way to write this code? It's the start of a hexeditor I'm creating. I'm aware that the variables aren't descriptive, this is just a test run for when I imbed it into a File ...
4
votes
1answer
39 views

Which loop to use for multiple if statements which serialize objects

I have figured out how to serialize multiple objects, however I am utterly convinced I can use some kind of loop for the if statements below, to avoid duplication. Please can someone advise how I ...
3
votes
1answer
57 views

Serializing multiple objects to a file

I am very new to Java and although my code works, I know that it must be possible to write this using fewer lines of code. I am serializing multiple objects, eventually I will look into serializing to ...
1
vote
1answer
45 views

Dynamic CSV Formatter

I made a dynamic CSV formatter as a personal challenge after having to hardcode a behavior to convert some data to CSV earlier. You input any List that contains supported types as properties (all ...
2
votes
0answers
67 views

Generic methods for serializing and deserialzing xml files using streams followup

Recently I asked this question: Generic methods for serializing and deserialzing xml files using streams However it has come to my attention that this gives me an (harmless) exception when trying to ...
1
vote
1answer
32 views

WebService --> XML Cache Repository

I'm working on a small application that uses a WebService to get meta-data about television episodes. What I'd like to do is start building out a local cache of the series so that I can reduce the ...
5
votes
6answers
152 views

__repr__ for a binary tree whose constructor has default arguments

I recently have been working on a BinaryTree class, and looked into creating a proper __repr__ which when eval'ed would recreate ...
1
vote
0answers
55 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 ...
0
votes
1answer
57 views

Pool readers and streams with Json.NET

This code is built on Json.NET and gets called hundreds of times per second. My data starts in an ArraySegment<byte>. I wrap that in a ...
11
votes
7answers
601 views

Numbers to byte-arrays and back

As the title explains, this is a series of extension methods that convert certain numeric types to and from byte-arrays, for certain actions which work better on byte-array types than numeric types. ...
2
votes
1answer
51 views

Three ways to read a number for a BitInputStream

I'm trying to learn how to write more readable code without introducing easily avoidable performance killers. This is part of a BitInputStream Java class I'm ...
3
votes
1answer
339 views

Little/Big Endian conversion

I wanted to make sure that my code is properly converting between the two endians. Here is the code where I read in an integer: ...
6
votes
2answers
409 views

Converting a SecureString to a byte array

Does it allocates something that hasn't freed? Something that remains in memory? Except result byte array, ofc. ...
1
vote
1answer
136 views

Re-use of read/write object , for multiple objects

I have read a lot about serialization and I cannot figure out how I am able to serialize then deserialize multiple objects. I am very much a newb to Java, so please bear with me. My code currently ...
4
votes
1answer
240 views

Converting string to dict using Python ast library

I have been trying to convert a string of dictionary objects as given below ...
5
votes
5answers
1k views

Menu to save and load football team information

I am a newb, and whilst I'm sure my formatting can be improved, I really want to know, how I can re-use my code for this simple program. The objective is simple, football game with a menu, that allows ...
8
votes
2answers
74 views

Racetrack game with reading the track from a file

For this community challenge I made the racetrack game. I'm reading the race data from a text file, which is available here. This is only playable by entering the velocity at the console. I've got ...
2
votes
3answers
929 views

XML serialization helper class

Yesterday was JSON serialization, today is XML serialization. I've taken some of the suggestions from there and made modifications, as well as making other modifications that were not suggested but ...
2
votes
1answer
196 views

JSON serialization helper class

I wrote this class to one-line all my JSON serialization, and I'm curious of any input on it. It's only responsible for serializing/deserializing any type to/from JSON. The comments and code are ...
6
votes
2answers
233 views

Binary serialization library

I am currently working on a binary serialization library written in C++11 for a personal project. I'd really like to have a review about my design, my implementation and everything else. The library ...
8
votes
4answers
5k views

Conversion of hexadecimal string to string

Given a C# string which is a set of hexadecimal numbers such as: string HexString = "202048656c6c6f20576f726c64313233212020"; Where those hexadecimal numbers ...
5
votes
1answer
469 views

Fastest De-/Serialise struct in .Net

I wrote this code to De- and serialise structures afap using IL generation (comments describes C# analogue). What can be improved here? ...
5
votes
2answers
157 views

Serialize/deserialize objects to and from database concurrently

I have a class which runs as spring bean in the container and its purpose is data persistence. In the overriden method ...
1
vote
1answer
51 views

Properly managing a collection from deserialized XML file throughout app's lifetime

I'm developing a WinForms app to manage some settings and profiles for multiple video games. The list of video games is specified by the user, and I'm trying to figure out how to properly maintain ...
5
votes
2answers
69 views

A tiny library for textual serialization of lists in Java - follow-up 3

See the previous iteration. I have incorporated the answer of h.j.k.. Now I have: LineStringSerializationFactory.java: ...
5
votes
1answer
66 views

A tiny library for textual serialization of lists in Java - follow-up 2

See the previous iteration. See the next iteration. I emphasized the fact that serialization routine may not return a string with new line character by using more or less explicit identifier. Moved ...
5
votes
2answers
62 views

A tiny library for textual serialization of lists in Java - follow-up

See the previous and initial iteration. See the next iteration. I have mainly refactored the code and made it a little bit robust (if serialization of a single object produces a string with new line ...
8
votes
2answers
156 views

A tiny library for textual serialization of lists in Java

Note: see the next iteration. I have this tiny library for (de)serializing lists of objects. The requirement is that each object's state may be represented textually as a single line of text. Later ...
7
votes
1answer
117 views

Persist values for a known set of keys in Python

Use case: I sometimes write programs that want to store a little state between runs, e.g., "What was the last file selected last time this program ran?" I wanted a convenient way to track this state. ...
4
votes
1answer
64 views

Serializable Queue header only library

I was hoping someone could check the library I 'm working on to see if they could give any suggestions. My biggest issue right now is getting tuple to work with more than just the basic types and I ...