Questions tagged [object-serialization]

The encoding of objects and the objects reachable from them into a stream of bytes. The complementary reconstruction of the objects is called deserialization.

61 questions
0
votes
1 answer

Getting object dependencies in PHP

I have an instance of the object which is dependent on other objects, e.g. $objA = new Some_Class(); $objB = new Other_Class(); $objC = new Another_One(); $objA->property = new stdClass; $objB->key = $objA; $objB->arr = array(new…
takeshin
  • 49,108
  • 32
  • 120
  • 164
0
votes
1 answer

Get object of object value with variable in Pug?

I want to use the value of a variable to access an object in Pug. elem : { Tuteur:{ Name:String, GivenName:String } } Example: let tmp = "Tuteur.Name", tmp_1 = "Tuteur.GivenName"; Code Pug: p #{elem[tmp]}; p #{elem[tmp_1]};
abbensid
  • 45
  • 7
0
votes
3 answers

Write and read byte[] from file

I'm looking for something simple (no external lib preferably) to write and load a byte[] from a file. More or less something like [Python's pickle][1]. byte[] bytes = new byte[10]; ByteBuffer bbuf = new…
wishi
  • 7,188
  • 17
  • 64
  • 103
0
votes
1 answer

Object Serialization in C++ for storing the OpenCV's SVM object [OpenCV 3.1.0]

So it is common knowledge that due to a bug in OpenCV when you try to load a non-linear kernel SVM after saving it you get an error. Refer here for more: OpenCV 3.1.0: Save and load trained SVMs People HAVE gotten the SVM to load but were unable to…
dohn joe
  • 11
  • 5
0
votes
2 answers

Flex Serialization for inbuilt components like...HBox, VBox, Panel, Canvas, DataGrid

Here is the problem...I'm working on a flex application(actionscript)... I have a Panel in my application which contains 2 buttons and 3 canvas components at certain posstions...now I want to store the current state of panel in some file or…
Rexo
  • 1
  • 1
0
votes
1 answer

How to change attributes, class hierarchy when a class is serialized

I have a base class in my SDK (Geometry) that serializes its members. Some members are just simple attributes & Elements like strings, and others are arrays of user defined classes. Now, I need to accommodate a change in my workflows which causes…
WAQ
  • 2,556
  • 6
  • 45
  • 86
0
votes
1 answer

QDataStream unable to serialize data

I am trying to follow the tutorial here and serialize Qt objects. Here is my code: QFile file("/Users/kaustav/Desktop/boo.dat"); if (!file.open(QIODevice::WriteOnly)) { qDebug() << "Cannot open file for writing: " <<…
SexyBeast
  • 7,913
  • 28
  • 108
  • 196
0
votes
2 answers

Unable to serialize and deserialize stack of strings in Qt/C++

I have an application where I need some data to persist, so I thought about object serialization. I found a nice example here. Following it, this is what I came up with: std::stack cards; cards.push("King of Hearts"); …
SexyBeast
  • 7,913
  • 28
  • 108
  • 196
0
votes
1 answer

Sending Crypto Objects via Java RMI

I'm using the Java RMI to send objects from a Client -> to a Server. Primitive objects works fine(e.g. String etc.) Java objects from the crypto library, throws exception. I need these Java Objects to settle on a secret key in a DiffieHellman Key…
user3711518
  • 253
  • 1
  • 3
  • 14
0
votes
1 answer

Deserialize viewstate string after Page.ViewStateUserKey is set

I am using the auto-generated code for preventing cross site forgery attacks with asp.net web applications - ie: protected const string AntiXsrfTokenKey = "__AntiXsrfToken"; private string _antiXsrfTokenValue; protected void Page_Init(object sender,…
Brent
  • 4,611
  • 4
  • 38
  • 55
0
votes
1 answer

Saving file with casting error

java.lang.ClassCastException: infrastructure cannot be cast to terrain at p2_assign_version2.main(p2_assign_version2.java:98) This is the error that is constantly being printed when I try to build my file. Due to this error i m not able to print…
0
votes
1 answer

Object Deserialization- to get back int array from serialized Object

int[] myIntArray; ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(1024); ObjectOutputStream objectOutputStream = new ObjectOutputStream(new…
Wiki
  • 245
  • 3
  • 13
0
votes
1 answer

Size of java.awt.Color object

I have a program in which I am using an ObjectStream over sockets. Code for the class Im sending looks like the following. class Snake{ Point[] p = new Point[50]; Direction move; public int length; int score; String player; Color snakecolor; boolean…
Sohaib
  • 4,556
  • 8
  • 40
  • 68
0
votes
1 answer

Play Framewrok object serialization with Akka

I have a play framework 2.0 connected to a remote akka systems in java language. I have a java array list object wrapped in a message class. the problem is that I want to send the message object to the remote akka system for computation. So , I…
faisal abdulai
  • 3,739
  • 8
  • 44
  • 66
-1
votes
1 answer

bufferedImage error while serializing and deserializing objects in Java

I'm trying to serialize and deserialize objects of class Download but I encounter the following error: java.io.NotSerializableException: java.awt.image.BufferedImage I have gone through my code for a long time but unfortunately I haven't found the…
Mahdi Ghajary
  • 2,717
  • 15
  • 20