See piece of code,
ByteArrayInputStream bis = new ByteArrayInputStream(objData.getBytes("ISO-8859-1"));
ObjectInputStream ois = new ObjectInputStream(bis);
I get this exception while trying to initialize the above "ObjectInputStream".
java.io.StreamCorruptedException: invalid stream header
----------------------------------------------------
----------------------------------------------------
java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:767)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:283)
at com.lxnx.ols.rosetta.history.shared.common.HistoryUtilsImpl.convertDOList(HistoryUtilsImpl.java:397)
The data was written like this
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
oos.writeObject(createLUForm);
String objData = baos.toString("ISO-8859-1");
String encryptSrchParamStr = LnAes.encrypt(objData);
objOutStream.writeObject(encryptSrchParamStr);
oos.close();
Anybody has any idea about the fix for this?
It would be helpful if you can send a sample piece of code.