1Z0-829 Java I/O API and Securing Applications Practice Question
Exhibit
Error log: java.io.StreamCorruptedException: invalid stream header: 73657200
Refer to the exhibit. What is the most likely cause of this exception?
⚠ Common exam trap
Many candidates confuse `StreamCorruptedException` with `InvalidClassException` (UID mismatch) or assume network corruption, but the specific hex value `546F6D` (ASCII 'Tom') is a clear giveaway that the file contains text, not random binary corruption.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The file contains non-object data (e.g., text) instead of a serialized Java object.
A `java.io.StreamCorruptedException` with the message 'invalid stream header: 546F6D' indicates that the input stream does not begin with the expected magic number `0xACED` (the standard Java serialization stream header). The hex value `546F6D` corresponds to the ASCII string 'Tom', which is plain text, not serialized object data. This occurs when a file containing non-object data (e.g., text) is read by `ObjectInputStream`.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The serialized object was tampered with after serialization.
Why it's wrong here
Tampering could cause invalid header, but the specific bytes 'ser' suggest text, not tampered binary.
- ✗
The serial version UIDs of the class and stream do not match.
Why it's wrong here
Version mismatch would not cause an invalid stream header; it would cause InvalidClassException later.
- ✗
The stream's magic number is wrong due to a network error.
Why it's wrong here
Network error could corrupt header, but 'ser' pattern is more consistent with text data.
- ✓
The file contains non-object data (e.g., text) instead of a serialized Java object.
Why this is correct
The bytes 'ser' are likely part of a text file; the stream is not a serialized object.
Go deeper
Related to this question
About these practice questions
One of 513 original 1Z0-829 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-829 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-829 exam.