02: JAXB with StAX Tutorial step by step for unmarshalling

This tutorial extends JAXB Tutorial for XML processing in Java step by step – unmarshall & marshall

When to use JAXB with StAX?

When you want to process large XML files, reading the whole file into memory can cause “OutOfMemoryError” as discussed in Java String & Array limitations and OutOfMemoryError post.

This approach is also good to process the middle of an XML document.

How to read the “book” author & title one by one?

JAXB and StAX in action

Output:

(Visited 48 times, 2 visits today)

800+ Java & Big Data Interview Q&As

200+ Java & Big Data Tutorials

Top