Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19493 > unrolled thread

serialize spoilers

Started bybob smith <bob@coolfone.comze.com>
First post2012-10-24 14:05 -0700
Last post2012-10-27 15:30 +0200
Articles 5 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  serialize spoilers bob smith <bob@coolfone.comze.com> - 2012-10-24 14:05 -0700
    Re: serialize spoilers Roedy Green <see_website@mindprod.com.invalid> - 2012-10-25 04:30 -0700
    Re: serialize spoilers Arne Vajhøj <arne@vajhoej.dk> - 2012-10-25 08:17 -0400
    Re: serialize spoilers Lew <lewbloch@gmail.com> - 2012-10-25 11:18 -0700
    Re: serialize spoilers Sebastian <sebastian@undisclosed.invalid> - 2012-10-27 15:30 +0200

#19493 — serialize spoilers

Frombob smith <bob@coolfone.comze.com>
Date2012-10-24 14:05 -0700
Subjectserialize spoilers
Message-ID<a4674ffd-d3fb-4801-b4c0-ac7c5c38ee35@googlegroups.com>
What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?

[toc] | [next] | [standalone]


#19498

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-10-25 04:30 -0700
Message-ID<mf8i88h0upg2j0gcaeepntgcliufot5u2a@4ax.com>
In reply to#19493
On Wed, 24 Oct 2012 14:05:00 -0700 (PDT), bob smith
<bob@coolfone.comze.com> wrote, quoted or indirectly quoted someone
who said :

>What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?
 If it is a built-in class, there is probably a good reason it is not
Serializable. For example Images contain platform specific
information, so you cannot save Images on one platform and
reconstitute them on another.

You can mark references transient, and restore them on your own
somehow.
 
You can look for some third party solution, or save them in some other
format, e.g. images as PNG files.

-- 
Roedy Green Canadian Mind Products http://mindprod.com
There are four possible ways to poke a card into a slot.
Nearly always, only one way works. To me that betrays a 
Fascist mentality, demanding customers conform to some 
arbitrary rule, and hassling them to discover the magic 
orientation. The polite way to do it is to design the reader 
slot so that all four ways work, or so that all the customer 
has to do is put the card in the vicinity of the reader. 

[toc] | [prev] | [next] | [standalone]


#19499

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-10-25 08:17 -0400
Message-ID<50892df3$0$291$14726298@news.sunsite.dk>
In reply to#19493
On 10/24/2012 5:05 PM, bob smith wrote:
> What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?

I think you could use Ted Neward's Serializable Adapter approach.

Unfortunately I can not find a working link to that anymore.

Arne

[toc] | [prev] | [next] | [standalone]


#19502

FromLew <lewbloch@gmail.com>
Date2012-10-25 11:18 -0700
Message-ID<a141f662-2fcf-4bdb-8a49-7f6c7c0ead7d@googlegroups.com>
In reply to#19493
bob smith wrote:
> What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?

Nothing without first reading the section of /Effective Java/ by Joshua Bloch that tells you how 
to deal with serialization.
http://my.safaribooksonline.com/book/programming/java/9780137150021
http://books.google.com/books?id=Ft8t0S4VjmwC&pg=PA289&source=gbs_toc_r&cad=4

You need to buy the book to get every page, but that's all right because you need to buy the book.

Suffice to say that there are mechanisms to deal with your situation, but you aren't going to learn 
the fundamentals of serialization by asking random questions on Usenet.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#19531

FromSebastian <sebastian@undisclosed.invalid>
Date2012-10-27 15:30 +0200
Message-ID<k6gnjn$me9$1@news.albasani.net>
In reply to#19493
Am 24.10.2012 23:05, schrieb bob smith:
> What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?

There is an approach by Olivier Croisier you might be able to use.
Here's a link (the page is in French):

http://thecodersbreakfast.net/index.php?post/2011/05/07/Serializing-non-serializable-objects

-- Sebastian

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web