This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes invalid stream header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "invalid stream header" Watch "invalid stream header" New topic

invalid stream header

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
Hi all
I am getting the below error when i tried to read the content form the byte[].
I am gettting the byte array from the services method (backend).

stacktrace: invalid stream header
at com.cccis.interfaces.iatpa.reprocess.POC.PayLoad.payLoadClient.convertBytesToObjectMsg(
at com.cccis.interfaces.iatpa.reprocess.POC.PayLoad.payLoadClient.main(
Exception in thread "main"

Any idea??
Santhosh Kumar
Ranch Hand

Joined: Nov 07, 2000
Posts: 242
ObjectInputStream is used to convert the set of bytes into object. It cannot convert any arbitrary set of bytes into an object. It has its own format. Usually you would use ObjectInputStream on stream which is created by ObjectOutputStream. So here the stream you are using (bArr) not in a format expected by ObjectInputStream.
subject: invalid stream header
Similar Threads
Please help me debug this - Converting Object to byte[] and vice versa.
Please help me debug this - Converting Object to byte[] and vice versa. NotSerializableException: java.awt.TexturePaint
String to bytes conversion.