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

0
votes
1answer
40 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
43 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
102 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
1answer
61 views

Type to byte array conversion in Swift

I need the byte representation of a given type, especially double, float, int8, etc. ...
8
votes
2answers
47 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
61 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
54 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 ...
3
votes
3answers
554 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
35 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
47 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
34 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
38 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
26 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
138 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
50 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
0answers
39 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
508 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
46 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
115 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
157 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
108 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
102 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
834 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
70 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
568 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
144 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
197 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 ...
5
votes
1answer
362 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
86 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
49 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
68 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
64 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
59 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
130 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
107 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
58 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 ...
10
votes
1answer
370 views

Rendering an HTML form based on a specification in a string

Here's a brief explanation of my method: Provide a string and parse it to HTML code respecting a specific format. The accepted format is: For dropdown menu : Test DropDown~Select:Options1; ...
2
votes
0answers
70 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 ...
1
vote
0answers
87 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 ...
4
votes
2answers
150 views

De-serializing and serializing objects to be sent over the network

I am serializing and de-serializing a class object within the class which is then sent over the network like this: ...
4
votes
1answer
68 views

Pickling cars with simple management system in Python

This is my first Python program (before that I've been just poking around with the interpreter itself). I took this opportunity to do some user input and play around with ...
7
votes
3answers
62 views

Saving and restoring RadixTree object

I have a large word-file which is fixed with over 240 000 words. I need to check if a specific word exists in this list. I thought that it would be a good idea to create a ...
10
votes
2answers
520 views

Optimize a generic foreach method that converts Datatable to my object using Reflection

I need to optimize this code block below, this method converts a Datatable object to the Object that I am passing by parameter, in another words, this serializes the object, however I have to run this ...
1
vote
1answer
180 views

Creating an adjacency list in C++

I want to create an adjacency list based on data I get from a text file. Could I make this simpler? ...
3
votes
2answers
92 views

Simple medical collection/database about patients visits

I am writing a system for doctors who are regularly visited by patients. The doctor adds each patient's visit to collection/database. The class can save data to an .xml file and restore it. Can you ...
4
votes
1answer
90 views

Generic Pickle-Aware Super-Class for Mixing Classes with and without __slots__ in Python

I want a generic super-class that I can easily subclass - and if desired add slots to my class - without having to worry about any pickle issues (with the lowest protocol). Is this in general a good ...
7
votes
1answer
194 views

Custom Serialization of Game World

I'm working with libGDX for a game, and over the last few days I have tried a few different types of serialization before settling on a custom serialization implementation. XML had huge file sizes, ...
4
votes
2answers
291 views

Data Persistence

I was wondering if I could get some feedback on the library I created to persist data online. JitterPushDemo.java ...
8
votes
1answer
72 views

Writing data into an image

I've done a script that will write things as images, which can then be read elsewhere (eg. you could share an mp3 through imgur). This is the first one I've done where I've been trying to improve my ...