This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes java.io.StreamCorruptedException: invalid stream header: C2ACC3AD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "java.io.StreamCorruptedException: invalid stream header: C2ACC3AD" Watch "java.io.StreamCorruptedException: invalid stream header: C2ACC3AD" New topic
Author

java.io.StreamCorruptedException: invalid stream header: C2ACC3AD

prasad phatak
Greenhorn

Joined: Sep 18, 2011
Posts: 5
Hi All,
please help me with this,the code prompt error on the console

java.io.StreamCorruptedException: invalid stream header: C2ACC3AD
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
at com.etp.dim.ui.CreateMapScreen$1.mouseClicked(CreateMapScreen.java:1146)
at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


When I tried to debugg the code,I found out its basically trying to get some data from a .mpf file. Can someone please me a precise reason why is this happening and an appropriate solution too.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

Did you create this file with an ObjectOutputStream? If the answer is no then you should not use ObjectInputStream to read it. It requires some header data which is written by ObjectOutputStream but apparently is missing in your file.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
GeeCON Prague 2014
 
subject: java.io.StreamCorruptedException: invalid stream header: C2ACC3AD