Reading an XML File using FileInputStream (for Java)?

The xstream.fromXML() method will do the reading from the input stream for you. I think the problem is that you are casting the return value from xstream. FromXML(fin) into a String when it should be cast to the type of object you originally serialized ( RandomTree I assume).

So the code would look like this.

From what I understand from xstream.codehaus.org/tutorial.html (I've never worked with XStream before), you need to define your types first. Casting to String is definitely wrong, you probably want a customized type (depending on what's inside your random XML), then you need to map the XML tags to your members.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions