473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to serialize and deserialize the objects into memory?

Hello Everyone,

I want to serialize and deserialize the objects into Memory not into
file. How can i do that?

Best Regards,
Jul 11 '08 #1
4 1873
hardemr schrieb:
Hello Everyone,

I want to serialize and deserialize the objects into Memory not into
file. How can i do that?

Use pickle & module StringIO/cStringIO as file-to-memory-object.

Diez
Jul 11 '08 #2
hardemr wrote:
Hello Everyone,

I want to serialize and deserialize the objects into Memory not into
file. How can i do that?
You want to serialize the objects, but only keep them in memory? That
hardly makes any sense. Serialization is need if you want to store your
objects in a file or if you want to communicate (via network) with other
processes.

-- Gerhard

Jul 11 '08 #3
On Jul 11, 12:58 pm, hardemr <emrahayano...@gmail.comwrote:
Hello Everyone,

I want to serialize and deserialize the objects into Memory not into
file. How can i do that?
pickle.dumps and pickle.loads.

--Inyeol
Jul 11 '08 #4
Gerhard Häring <gh@ghaering.dewrites:
You want to serialize the objects, but only keep them in memory?
That hardly makes any sense. Serialization is need if you want to
store your objects in a file or if you want to communicate (via
network) with other processes.
If one needs to do further processing on the serialised stream before
storing or transporting it, one needs to handle it in memory.

Fortunately (as pointed out elsewhere in this thread) the pickle
module provides for this.

--
\ “I love and treasure individuals as I meet them, I loathe and |
`\ despise the groups they identify with and belong to.” —George |
_o__) Carlin, 2007 |
Ben Finney
Jul 11 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hollywood | last post by:
After doing a search through google's archives of this list, I didn't see what I was looking for so here goes... Is it possible to serialize/deserialize multiple objects from a single XML file? ...
14
by: vince | last post by:
Can I add (append) to an xml file that already contains a serialized object, and be able to deserialize to either or both objects from the same file...??? How is this done...?? thanks, vince
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
3
by: Gislain | last post by:
Hello, I'm looking for a best way to serialize multiple / different object in the same XML file, and of course, how can i deserialize it. Actualy, when i serialize the first object in XML...
5
by: Brad | last post by:
I would like to serialize an arraylist of objects to xml so I can store the xml in a database column. How would I code the serializing and deserializing? Below is a (overly) simple, incomplete...
0
by: John Manion via .NET 247 | last post by:
Long Post, thanks for your patience... I have and XML file that looks something like this: <?xml version="1.0" encoding="utf-8" ?> <Settings> <Location> <X>30</X> <Y>40</Y> </Location>...
3
by: Mirek Endys | last post by:
What is the best way to serialize object, that contains data in interfaces. Simple. I have instance of my object, that contains data in interfaces. What is the best way to XMLSerialize and...
4
by: =?Utf-8?B?Qnlyb24=?= | last post by:
When I try to serialize an instance of the LocationCell below (note Building field) I get an error in the reflection attempt. If I remove the _Building field it serializes fine. I tried renaming...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I am using dotnet remoting with a binarry formatter. I have a property that returns a memorystream that has had a file loaded into it. When I try to access this property though I get an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.