Questions tagged [binary-deserialization]
34 questions
1
vote
2 answers
Reading an int through char* buffer behaves different whether it is positive or negative
Background: I was wondering how to (manually) deserialize binary data if we got them through a char * buffer.
Assumptions: As a minimal example, we will consider here that:
I have only one int serialized through a char* buffer.
I want to get the…

Fareanor
- 5,900
- 2
- 11
- 37
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…

timcardenuto
- 40
- 6
1
vote
2 answers
C# Serialization - Could not find the assembly
I am working on C# TCP Server-Client programming. My problem is simple but somehow i couldnt figure it out.
I have an object i would like to seriliaze this object send over socket and deserialize client side. But problem is with deserializing. I…

Emirhan Özsoy
- 43
- 8
1
vote
1 answer
C# deserializing a binary structure with bitfields - how to do?
I have a C struct that is defined in a way similar to this:
struct TestStruct
{
uint flag1 :2;
uint flag2 :2;
uint flag3 :2;
uint flag4 :2;
uint value1;
} TestStruct;
I know that I can deserialize a binary struct by using the…

Mario The Spoon
- 4,799
- 1
- 24
- 36
1
vote
1 answer
Decode a binary protocol in python
Im trying to write a simple python client to decode a binary stream generated from a program called sdrdaemon.
The protocol is described here (copied below for convenience). My understanding is the first 42 bytes should contain the meta frame which…

dgorissen
- 6,207
- 3
- 43
- 52
1
vote
1 answer
Serialization of ISolution - Roslyn CTP3
I have been experimenting with Roslyn in the context of meta-programming, but have encountered difficulties in persisting ISolution or IProject objects to a database. Here is what I have tried to serialize ISolution objects to a byte array and then…

Beaker
- 2,804
- 5
- 33
- 54
1
vote
1 answer
Binary deserialization: get object data
Is it possible to get data of the binary serialized object ( or list of othe same objects ) as it can be done in XML or soap. Please note, I have no idea about object structure ( private and public fields,etc)? By data of the binary serialized…

seeker
- 3,255
- 7
- 36
- 68
0
votes
0 answers
Serialize/De-Serialize Optional values using IoBuffer
In our project we are using the org.apache.mina.core.buffer.IoBuffer to serialize and deserialize objects and send it through the network.
There is one more requirement to send Optional values over the same. Optional<> being a non serializable…

Ravi Bodla
- 1
- 1
0
votes
5 answers
DeSerialization gives weird runtime error?
De-serialization not working. It gives me the following run-time error:
Unhandled Exception: System.InvalidCastException: Unable to cast object of 'Measurement' to type 'Measurement'.
I really can't see what is wrong with it.
//start alternate…

Demi
- 318
- 1
- 4
- 13
0
votes
1 answer
Read int through char * binary data from a file with std::ifstream::read()
Background: This question is a follow up of this one.
The given answer suggesting to access the data through unsigned char * instead of char* worked successfully.
Main question: But how can we do if we have no choice ? (i.e. if char* imposed by a…

Fareanor
- 5,900
- 2
- 11
- 37
0
votes
1 answer
Deserializing types from binary file into different namespace in different app (C# .NET)
In application called "application1" I serialize this structure into binary:
namespace namespace1
{
[System.Serializeable]
class ClassA
{
List List
}
}
In application called "application2" I have to deserialize this binary…

Joakim
- 31
- 3
0
votes
1 answer
How to convert a 2D binary object in to a Dictonary in C# using Binary Formatter
I want to convert an objeect of byte[][] type to Dictonary.
It always give an error "End of Stream encountered before parsing was completed."
Please help me .
public static object ByteToObjectArray(byte[][] ms)
{
BinaryFormatter…

Vivek Verma
- 293
- 3
- 16
0
votes
1 answer
Before completing the analysis was detected ending stream
It's me again and I have another problem. Somewhere, I've found following code:
private T DeepDeserialize(string fileName)
{
T returnValue;
using (FileStream str = new FileStream(fileName, FileMode.Open))
{
…

SoptikHa
- 437
- 4
- 19
0
votes
0 answers
End of Stream encountered before parsing was completed while deserializing
I am getting above error while deserializating BinaryFile to Object. I have tried set position=0, seek.begin method and tried with memory stream but no use. Every time i am getting same issue. Can anybody help me out?. Below is my code snippet for…

user2845419
- 31
- 3
0
votes
1 answer
BinaryFormatter OptionalField with ISerializable
I create a test serializable object:
[Serializable]
public class TestObject : ISerializable
{
public string FirstName;
public TestObject()
{
}
public TestObject(SerializationInfo info, StreamingContext context)
{
…

MajorInc
- 342
- 3
- 12