Serialization is the process by which an object is converted into a format that can be stored and later retrieved.
0
votes
0answers
44 views
Serialize data into one byte array using ByteBuffer
I have a class in which I am passing certain parameters through the constructor and then using those parameters to make one final byte array with a proper format (header + data):
...
4
votes
3answers
114 views
Setting Entity Framework up for success
So I am working on an application (top-secret!) that I need settings for, these settings are pretty basic, but I don't want to make a single-row table with a bunch of serialized settings, or a single-...
2
votes
1answer
85 views
Reading a string-to-string map from an archive
I have a CArchive with contains a serialized CMapStringToString.
From my research it is my understanding that it is quite ...
0
votes
4answers
52 views
Creating enchantment objects based on configuration
I'm searching a way to literally shorten my code.
For the moment my code is this;
...
3
votes
1answer
73 views
Serialize and deserialize binary tree
Here is my code of serialize and de-serialize a binary tree, looking for advice. One issue in my mind which I cannot resolve is, I am using a global variable index, wondering if more elegant solutions ...
4
votes
2answers
64 views
ConcurrentDictionary, Store Key and Compression
So i have a ConcurrentDictionary<int, string>
The "int" is merely the way i store the key, which i want more recommendations on.
Currently i do like this.
...
4
votes
1answer
238 views
Converting HEX values to Unicode characters
I have a small bot for social network, which accepts message "unicode XXXX XXXX XXXX ...", where XXXX - HEX values which I ...
3
votes
1answer
83 views
Serialize and deserialize a tree
Suppose each node of a tree has maximum n children. I want to serialize and de-serialize for a tree. My current solution is doing pre-order traverse, and using <...
3
votes
1answer
33 views
Python date compression
I m making a script to store date information in the smallest size in bits
(I don't mind of the actually memory use in the program / runtime)
...
-1
votes
1answer
55 views
Construct: (un)dumping bytes to hex
This code is part of the Construct library. Docstrings explain what the code is supposed to do.
...
1
vote
0answers
27 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
...
5
votes
1answer
161 views
Converting a bytearray into an integer
I am working on a program to decode MMS PDU files. They are binary files and I am reading them byte by byte and decoding each header value as I come to it.
One header value is the Date, and it's ...
6
votes
4answers
242 views
Hex encoding and decoding of ASCII strings in VBA
I needed to convert some Ascii text to binary in Hex format 0x00FF....
I've written an EncodeHex and a ...
1
vote
1answer
75 views
Translating binary data from a file into a very large base-ten integer
I'm making an experimental Java algorithm that translates binary data from a file into a (very large) base ten integer. I am using BigInteger since this number may ...
4
votes
1answer
51 views
Serializing Objects to Delimited Files Part II
This is a follow up to my previous question: Serializing objects to delimited files
I've added some feature enhancements, and based on suggestions from rolfl in chat, I've fixed up a couple ...
3
votes
1answer
189 views
1
vote
0answers
45 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 ...
10
votes
3answers
249 views
Structure to ByteArray Extension
I have a need to turn various structures into byte arrays to be sent over serial port to another machine. I created generic extensions to turn any structure into a byte array and from a byte array ...
5
votes
2answers
78 views
Parsing shorts from binary file and finding the closest and furthest points
A few months ago I got rejected at the technical interview for a position.
The problem that they gave me is the following:
From a binary file, parse two shorts, x and y and build a Point object with ...
3
votes
1answer
1k views
Hex String to Bytes (NSData)
I'm trying to convert this Objective-C code (originally found in this Stack Overflow question) which turns an NSString into ...
5
votes
2answers
144 views
Packing and unpacking bits (2)
Part 1 here.
I improved my code from my previous question (linked above).
...
6
votes
2answers
233 views
Packing and unpacking bits
Part 2 here.
I wrote this class for packing data.
Would it benefit from being named BitPacker rather than BitStream (and change write/read to pack/unpack), or it works as is?
How can I improve it? ...
2
votes
1answer
79 views
Encoding a list of frequencies as WAV audio
This code gets a list of signals with predefined frequency from struc.num
I need to encode it to wave format, so i use this code. This works, but i dont sure it is a correct decision to encode like ...
5
votes
1answer
63 views
8
votes
2answers
225 views
Reading binary files in XTF format
I have a few thousand binary files that have corresponding structs in them, followed by any number of bytes (this exact number of bytes is given in one of the fields in the structs). I read in data ...
2
votes
0answers
205 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.
...
3
votes
1answer
59 views
Save/Load GridView layout using SettingsService
I am able to save my GridView layout by storing a string representation of the items in the ...
4
votes
2answers
177 views
Binary protocol variability V2.0
Up-to-date Version of this question: Binary protocol variability V3.0
Summary of the problem: Parsing an incoming stream of events from a binary communication protocol, if we have some variations in ...
3
votes
2answers
70 views
Netstring parser in common lisp
Below is a netstring parser I wrote in Common Lisp. The docstring contains the usage and return.
...
3
votes
3answers
346 views
Binary protocol variability
Please note: An updated solution is here
Let’s imagine that we designed more or less universal firmware for a microcontroller unit to be used across multiple types of devices. So we have something ...
0
votes
2answers
346 views
Returning a byte array from a method [closed]
public abstract class Element
{
// Removed for verbosity ...
protected abstract byte[] GetBytes();
}
I'm attempting to create an engine that can create a ...
1
vote
0answers
62 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:
...
3
votes
1answer
89 views
Serialize and deserialize n dimensional int array
I've made two symmetric methods which serialize an int array of any number of dimensions into an OutputStream, and read such an array from an InputStream. I was wondering if there is ways this code ...
2
votes
1answer
92 views
Class for serializing generic gson objects
I realized I had just created two classes that were virtually identical for simply saving objects to their own json files, so I've attempted to make it more generic. My only noticeable problem is ...
4
votes
1answer
58 views
LEB128 in Haskell
I have implemented the LEB128 encoding for unsigned integers. I'm fairly new to Haskell so I have some doubt about the coding style I'm using, particularly the definition of ...
4
votes
1answer
97 views
How to separate data from logic when serializing types - grid tile map example
I am creating a tile based game in Unity and ran into a problem with my architecture of the Map and Tile types. The tile class contains logic like events when the tile type changes. When I tried to ...
5
votes
1answer
392 views
Serializing objects to delimited files
For a new project I'm going to need to be able to serialize random types to TSV or CSV files, so I write a class which can be used to serialize any object to a TSV, CSV or any other _SV file you can ...
2
votes
3answers
152 views
Code Smell in Unit Testing Serialized Classes
I can feel that something is wrong with my code. Here's an excerpt where I think the code smell is...
...
1
vote
3answers
68 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 FPE2-...
1
vote
1answer
58 views
11
votes
2answers
132 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. Basically,...
2
votes
2answers
67 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
44 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
157 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
68 views
Object parser in C++
Consider the following contrived data type:
Building: int age, char* location, float ...
1
vote
0answers
108 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
78 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
540 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
332 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
837 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 ...