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
4
votes
2 answers

Not marked as Serializable error

I have a class 'Entity' [Serializable] public class Entity { public Guid Id { get; set; } public IEnumerable ChildEntity { get; set; } } I would notice that it has property ChildEntity which is a list of same class Entity.…
siddharth
  • 149
  • 5
  • 13
4
votes
5 answers

Saving a Dictionary in C# - Serialization?

I have a dictionary in c# private Dictionary userSessionLookupTable = new Dictionary(); Now I have created a dictionary object this.userSessionLookupTable.Add(userSessionInfoLogin.SessionId,…
S M
  • 3,133
  • 5
  • 30
  • 59
4
votes
2 answers

binary serialization, adding a new field to class - will it work?

I have a client and a server application which communicate over .NET 2.0 Remoting using binary serialization. A small change has been made to one of the data transfer object's interface and the implementing class, well, an array of strings field…
4
votes
1 answer

How to Convert Primitive[] to byte[]

For Serialization of Primitive Array, i'am wondering how to convert a Primitive[] to his corresponding byte[]. (ie an int[128] to a byte[512], or a ushort[] to a byte[]...) The destination can be a Memory Stream, a network message, a file,…
jlevet
  • 104
  • 9
4
votes
2 answers

Why can't the 'NonSerialized' attribute be used at the class level? How to prevent serialization of a class?

I have a data object that is deep-cloned using a binary serialization. This data object supports property changed events, for example, PriceChanged. Let's say I attached a handler to PriceChanged. When the code attempts to serialize PriceChanged, it…
ck.
  • 1,056
  • 1
  • 14
  • 25
4
votes
1 answer

Serializing multiple objects into one binary file

I have an MDI application with a treeview control docked to the left and five classes containing the information of the tree nodes i.e Editors for that kind of node. How should I serialize the application such that all the objects are serialized…
Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91
4
votes
3 answers

Deserialize types moved across assemblies

I have a bunch of types which have been moved from one assembly to another. I am trying to deserialize data which was serialized using the old assembly into types in the new assembly by using a SerializationBinder. EDIT: Root namespace of the…
Vinay B R
  • 8,089
  • 2
  • 30
  • 45
4
votes
4 answers

Convert a byte[] array into DataTable

I saved an object of type DataTable into SQL 2005 database in a field of type varbinary. I want to retrieve it back but I wasn't able to type cast it. This is how i saved it. MemoryStream memStream = new MemoryStream(); StreamWriter sw = new…
Ahmad Farid
  • 14,398
  • 45
  • 96
  • 136
3
votes
2 answers

How can I serialize a 3rd party type using protobuf-net or other serializers?

I have List but protobuf-net gives me error that it doesn't have a contract. How can I specify a contract for it when I don't have the source? It actually said it couldn't infer the type but I assume it's because I didn't…
Joan Venge
  • 315,713
  • 212
  • 479
  • 689
3
votes
3 answers

Fast and comprehensive binary serialization framework for Windows Phone 7

I am looking for a fast binary serialization framework to use in Windows Phone 7 for a project I am migrating from Windows Mobile 6.5 Protobuf-net works great in WM6.5, but it is still far from prime time in WP7, so I was wondering if anyone knows…
3
votes
1 answer

VB.NET serialization error

I'm trying to serialize the main class in my VB solution. I've added the Serializable attribute at the top of my class like so: Public Class Form1 and I'm using the following code to serialize: Public Sub serializeThis() Dim…
Flash
  • 15,945
  • 13
  • 70
  • 98
3
votes
3 answers

.NET Binary Serialize object with references to other objects . . . what happens?

If you have an object instance A that references other objects (for example instances B and C), and you binary serialize A to a file, what happens? Do you now have serialized data that includes A, B and C? How does it work exactly? What will I get…
richard
  • 12,263
  • 23
  • 95
  • 151
3
votes
1 answer

Dropwizard and Protocol Buffers by example

Please note: Although this question specifically mentions Dropwizard, I believe anyone with Jersey/JAX-RS experience should be able to answer this question, as I would imagine Dropwizard is just following Jersey/JAX-RS conventions under the hood. I…
smeeb
  • 27,777
  • 57
  • 250
  • 447
3
votes
1 answer

Does protobuf-net support ArraySegment (yet?)

I have read Protobuf-net memcache provider fails on append/set ArraySegment which says it may be supported at some point. I have also tried the test suggested in that question, which indicates that version 2.0.0.668 does not support it. Has anyone…
JoshSub
  • 499
  • 1
  • 4
  • 11
3
votes
2 answers

Scala bitfields serialization

I am extremely new at Scala and I'm getting confused by the bit manipulation features. I am hoping someone can point me in the right direction? I have a byte array defined with the following bit fields: 0-3 - magic number 4 - version 5-7 - payload…
Will I Am
  • 2,614
  • 3
  • 35
  • 61
1 2
3
11 12