Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.3.1
-
Fix Version/s: None
-
Component/s: Core
-
Labels:None
-
JDK version and platform:jdk1.6.0_20
Description
Hi,
I have an XML which I created using XStream. This file is formatted like this:
<entity>
......details of entity....
</entity>
<entity>
......details of entity....
</entity>
<entity>
......details of entity....
</entity>
......
Basically I obtained this file by serializing objects from a list one-by-one. Now, I want to read this file in the same way (one-by-one). This is because I don't want to load 1Gb od data into memory and after that process each entity. I want to read first entry (entity) and process it. After that I want to read the second entry (entity) and process it... and so on. Is there any way to obtain this using XStream? I managed to read the first entry using this code:
InputStream inputStream = new FileInputStream(path);
XStream stream = new XStream(new StaxDriver());
stream.processAnnotations(Entity.class);
while (true)
but I can't move to the next one.
Thank you
Please use the user's list, if you have questions about XStream's usage.