views:

115

answers:

2

In the same way that you can use JSON in javascript? At least the static properties?

Or maybe even for hash-table streaming?

Is it oversimplistic about hoping to find something like

Object.Serialize(stream) where stream is a file, overrideable with your choice of other likely candidate targets, using some default format, say XML?

With Object obj = stream.Deserialize() ...

A: 

I suggest you look at XStream for .Net. I haven't used that variant, but found the original XStream quite straightforward to use in Java.

joel.neely
+1  A: 

Java supports this with the XMLEncoder since 1.4. The format is quite compact and XMLEncoder allows to override the serialization of specific object classes, so you can use the default where it fits and do whatever you want to elsewhere.

Aaron Digulla