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
1
vote
5 answers

Java Object Serialization - How to add member variable?

I have an array of objects that I am able to read and write to disk. But now I want to add a member variable to my class. If I add the member variable, I'll get a class incompatible error and I won't be able to read my serialized objects. Is…
486DX2-66
  • 159
  • 2
  • 10
1
vote
3 answers

PHP remove object reference before serialize, restore after

I have some objects that I wish to cache on disk. I use serialize() in this process. The objects contain some references to other objects. I don't want those to be serialized as well (that is done in some other place) because it would give me…
Bart van Heukelom
  • 43,244
  • 59
  • 186
  • 301
1
vote
3 answers

Java: Serialize a Collection XML

Every time I've searched for something on how to serialize to XML, I found the bean serializers. It seems that everything has to be declared as a property, which defeats my purpose. I want to serialize complex hierarchies (until they get to…
Dan Rosenstark
  • 68,471
  • 58
  • 283
  • 421
1
vote
1 answer

Using Serializable attribute with base class only in class declaration

I have a class which uses object serializer to serialize properties. The class is derived from another class as follows [Serializable] public class TargetInfo: PropertyHandler When I call the serialize method, serializer tries to serialize the…
WAQ
  • 2,556
  • 6
  • 45
  • 86
1
vote
2 answers

How to serialize Java object - converting object as an InputStream

If I write my code like this, it gives an error "File not found access denied ......" public class ImplRegistration implements IRegistration { @Override public boolean newRegistration(Registration_BE reg_be) { FileOutputStream fos = new…
sabarirajan
  • 177
  • 2
  • 3
  • 13
1
vote
4 answers

Continue with Object serialization or use database?

I have written a math game in Java, and have distributed some copies to a few beta-testers. The problem is that the version I have given them is saving the GameData via object serialization, which I found out is mainly for sending Objects, or in…
Mike Warren
  • 3,796
  • 5
  • 47
  • 99
1
vote
2 answers

ObjectInputStream and getInputStream

I'm working on a school project and the following codes are an example provided for building the project (should work without any problem but not...). There was no compiling error but when I use telnet to test it the following message…
1
vote
1 answer

serializing an object with a byte array of a file as a field

I am sending a file over the network using a client-server program. After reading the bytes of the file (with File.ReadAllBytes()), I set the byte array as a field of an object. Then serialize and send the object to the client, where the client…
manas
  • 397
  • 6
  • 25
0
votes
1 answer

Perl Expect with FreezeThaw

I am converting an interactive command line tool to a web application, with the tool as the backend. I take in user commands (using AJAX) and call a perl CGI script that extracts the command. I then use expect to send the command to the process,…
krish7919
  • 892
  • 2
  • 13
  • 30
0
votes
1 answer

Does object serialization help in runtime or initialization speed up?

I have a project to be converted from C++ to Python. The project was originally written by others. The logic is described as below: "It loaded 20 plain text files in which each line represents a record of 7 columns. It then parses each line and…
marlon
  • 6,029
  • 8
  • 42
  • 76
0
votes
2 answers

Is there a better way to do object serialization for this class?

I am reading other's code and there is a serialization version of this class: struct ObjectInfo { int32_t m_typeId; string m_objectName; vector m_haveKeysId; map m_objectFeatures; …
marlon
  • 6,029
  • 8
  • 42
  • 76
0
votes
1 answer

How can I serialize an derived type pointer to interface type object in c++?

Interface * base_ptr1 = new Derived1(); Interface * base_ptr2 = new Derived2(); In theory I should have serialize() method in all classes but my interface type class does not have data members, only abstract virtual methods.
0
votes
1 answer

How can I save an object to a file in Dart and read it again?

I have already done that in Java using ObjectOutputStream and ObjectInputStream classes. Now I want to do this with Dart. I have no idea about what I should use. I have also researched on google but I only found something for serialization of…
Daniel
  • 11
  • 1
  • 6
0
votes
0 answers

Connecting to API (post) with Content type application/x-www-form-urlencoded using c#

I have an object as follows: public class TextMessageInput { public string To { get; set; } public string Body { get; set; } public string From { get; set; } } I am trying to serialize this object and send it to any API with…
akhila
  • 720
  • 2
  • 7
  • 17
0
votes
1 answer

Java-Sockets: How to send and serialize object between multiple applications

I have 2 maven applications that should communicate via server socket and socket. If possible, I want to send the data as a Java-object, but for that I need both of those projects to include the class of the object. If possible, I don't want to make…
Patrick
  • 552
  • 5
  • 17