Questions tagged [binary-serialization]

The process of translating data structures or object state into a binary format

Serialization can be defined as the process of storing the state of an object to a storage medium. During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created.

http://en.wikipedia.org/wiki/Serialization
http://msdn.microsoft.com/en-us/library/72hyey7b(v=vs.110).aspx

178 questions
1
vote
1 answer

Wire Protocol Serialization

I'm looking for what I'll call a 'binary serializer/deserializer code generator' for lack of a better term that specifically allows you to specify the on-the-wire format with arbitrary bit lengths and then generates the necessary C/C++ code to…
1
vote
2 answers

Serialization problem : System.UnauthorizedAccessException

I am getting this error: An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll Additional information: Access to the path 'C:\Users\Storm Kiernan\Desktop(NEW)Archetype Development…
1
vote
1 answer

Serialize POCO to Simple Byte Array

I have a need to serialize the following type public class MspMessage { [DataMember(Order = 1), ProtoMember(1)] public byte[] Prefix { get; private set; } [DataMember(Order = 2), ProtoMember(2)] public MspMessageType MessageType {…
davidbitton
  • 818
  • 10
  • 20
1
vote
1 answer

Deserializtion returns a field of a class instead of the class

I have a class, named Schematic, that stores a structure of blocks for use in my game. I'm trying to get a way to save and load them using the BinaryFormatter, however I have an issue with the deserialization. When I deserialize, I cannot cast to my…
1
vote
0 answers

OrientDB-NET.binary - Saving Emoji not working

I'm trying to save text that contains items such as emoji's, e.g. :point_right:. I can save the same text directly in the management UI. So I don't think that it is a database configuration issue, its currently set to UTF8 which is correct AFAIK. I…
Darren Bell
  • 75
  • 1
  • 5
1
vote
1 answer

Send myObject by TCP/IP

I have a problem from send myObject by TCP/IP. My ArchMap public class ArchMap { public string DetalCode { get; set; } public List Archs { get; set; } } and Arch public class Arch { public string ModulName { get; set; } public…
18666
  • 125
  • 1
  • 18
1
vote
3 answers

Conditional C# Binary Serialization

I am using BinaryFormatter to serialize a class and its variables by condition. For example: [Serializable] public class Class1 { private Class2 B; ... } [Serializable] public class Class2{...} I want the variable B to be serialized only when…
felonny
  • 11
  • 2
1
vote
1 answer

polymorphism in c and buffers

I have this union: typedef union Message { message_base base; message_with_parameters parameters; reply_message reply; buffer_t *buffer; // can't figure out what to put here }…
the_drow
  • 18,571
  • 25
  • 126
  • 193
1
vote
1 answer

Sending interfaces as message in NServiceBus with the Binary Serializer

I recently moved to using the binary serializer to send messages with NServiceBus. My messages are all defined as interfaces and are instantiated using bus.Send(msg => msg.Property = someValue) This leads to an exception being thrown…
mattcole
  • 1,229
  • 2
  • 12
  • 22
1
vote
0 answers

Why binary files serialization has certain performance and size benefits?

Why binary files serialization is faster to serialize and capture relatively small amount of disk-space in compare to text files serialization?
Yair Nevet
  • 12,725
  • 14
  • 66
  • 108
1
vote
1 answer

Binary Serialization to ResultBuffer in C#

I have a working XML Serializer which serializes a C# object to an entity in AutoCAD. I'd like to be able to do the same thing but with Binary Serialization for the cases in which XML does not work. So far my serialization method looks like…
Nick Gilbert
  • 4,159
  • 8
  • 43
  • 90
1
vote
1 answer

BinaryFormatter seems to be appending rather than overwriting

I have created a load file to keep track of all characters created in a game in order. There is a 15 character limit so whenever the players creates a new character I need to check whether or not that limit was reached. However when I try to modify…
Jaja
  • 51
  • 8
1
vote
2 answers

PER encoding without tag and length info

Using asn1 PER encoding, is there some way to encode data using only content bits i.e without tag and length information? I am trying to fit a legacy binary protocol onto an asn1 specification, and that would only be possible if there was an…
Ajoy
  • 525
  • 1
  • 9
  • 20
1
vote
1 answer

C# file won't save

Saving or reading a file, what is wrong? This creates empty files. I'm confused, please tell me how to do it properly. As you can see I'm trying to save a class and then read an array of them back. public void savePlayers() { string path =…
1
vote
2 answers

Boost Serialization Binary Archive giving incorrect output

I am trying to Serialize a class. Class definition: class StartPeerSessionRequest { public: StartPeerSessionRequest(); virtual ~StartPeerSessionRequest(); void composeRequestwithHardCodeValues(); void save(); stringstream…