qq_22327273
wuydit
2015-12-13 10:54

java io invalid stream header: 776F7264

2
  • java
  • arraylist
 java.io.StreamCorruptedException: invalid stream header: 776F7264
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:806)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
    at dictionary.DictionaryClass.load(DictionaryClass.java:105)
    at dictionary.DictionaryClass.<init>(DictionaryClass.java:21)
    at dictionary.Dictionary.<init>(Dictionary.java:14)
    at dictionary.Dictionary.main(Dictionary.java:19)
        System.out.println("反序列化进行中");
        File f2 = new File("F:\\Text.txt");
        ObjectInputStream ois = null;
        FileInputStream fis = null;
        try {

            fis = new FileInputStream(f2);
            ois = new ObjectInputStream(fis);
            if (f2.exists()) {
                System.out.println("反序列化对集合赋值");
            this.collection = (ArrayList<DictionaryNum>) ois.readObject();
                System.out.println("赋值成功");
                ois.close();
            } else {
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐