无效的流标头:2C6D0005-StreamCorruptedException [英] Invalid stream header: 2C6D0005 - StreamCorruptedException

查看:61
本文介绍了无效的流标头:2C6D0005-StreamCorruptedException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从servlet应用程序中下载了序列化的Java对象.当我尝试用Java代码打开它时,我得到:

I downloaded a serialized Java object from my servlet application. When I try to open it in Java code I get:

java.io.StreamCorruptedException:无效的流标头:2C6D0005

java.io.StreamCorruptedException: invalid stream header: 2C6D0005

我搜索了互联网,找不到对代码 2C6D0005 的任何引用.

I searched internet and could not find any reference to code 2C6D0005.

是什么原因造成的?

请注意,我已经使用此servlet应用程序下载了许多其他序列化的对象,并且之前从未见过此问题.

Note that I have used this servlet application to download many other serialized objects and have not seen this problem before.

推荐答案

这不是错误代码.您认为文件是序列化数据的前4个字节,但不是.

It's not an error code. It's the first 4 bytes of the file you think is serialized data, but isn't.

字节应为 AC ED 00 05 ,其中前两个字节为魔术",而 00 05 为版本.

The bytes should be AC ED 00 05 where the first two bytes are "magic" and 00 05 is version.

请参见公开了Java序列化算法文件格式以及其他信息,如果规范,仍然不清楚.

See Java Serialization Algorithm Revealed for the file format as well as other information, and The Specification if something is still unclear.

好,由于我必须离开工作,我将为您免除悬念.在某个地方,某人无法正确读取字节.如果清除 AC ED 的高位,则会得到..... 2C 6D .您应该与编写相关代码的人交谈,然后对其进行修复.

Fine, I'll spare you the suspense since I have to leave work. Somewhere, someone is not reading bytes properly. If you clear the high bit of AC and ED, you get..... 2C and 6D. You should talk with the person who wrote the relevant code and then fix it.

这篇关于无效的流标头:2C6D0005-StreamCorruptedException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆