Hi,
i need to do some object-serializing from/to
String variables.
I'm not very familiar with this stream stuff so please could someone
post some code particles.
I use the XMLEncoder/XMLDecoder Classes from java.beans
I either have an Object and want its XML representation written to a String.
Or i have the String with the XML representation and want to recreate the original Object.
java.beans gives me these two Classes (See API
Doc Quotes) that work like a charm if i read/write from/to files.
So how would i go on with Strings insted. A surplus would be if we could have the Strings zip compressed/decompressed on reading/writing.
(This XML is HUGE)
Only thing i could find was some half-cooked stuff that changed all the beautiful UTF-8 characters in the XML to ??. Dang!
XMLEncoder
public XMLEncoder(OutputStream out)
Creates a new output stream for sending JavaBeans to the stream out using an XML encoding.
Parameters:
out - The stream to which the XML representation of the objects will be sent.
See Also:
XMLDecoder.XMLDecoder(InputStream)
XMLDecoder
public XMLDecoder(InputStream in)
Creates a new input stream for reading archives created by the XMLEncoder class.
Parameters:
in - The underlying stream.
See Also:
XMLEncoder.XMLEncoder(OutputStream)
You really could make my day here.
Thank you,
J.