file - java.io.StreamCorruptedException: invalid stream header: 00000001 Simple Project -


My problem is that my project (a simple inventory in which the items are serialized in a folder and then deserialized) is a " Java.io.StreamCorruptedException: Invalid Stream Header: 00000001 "When I tried to deserialize information I had no problem before; However, when I manually delete one of the serialized files with Finder (MAC), then this is when the exception was thrown. My code for Deserializing is:

  Private Zero compileInventory () {// Run through the text file and inventory inv = new & lt; Item & gt; ArrayList (); File f = new file (local); File [] list = f.listFiles (); Inv.clear (); If (f.exists ()) {for (file n: list) {try {fileInputStream fileIn = New FileInputStream (n.getAbsolutePath ()); ObjectInputStream = In New ObjectInputStream (fileIn); IN.Add ((item) in.readObject ()); In.close (); FileIn.close (); } Hold (IOException i) {i.printStackTrace (); Return; } Grip (Klassnotfound exception c) {System.out.println ("Item category not found"); C.printStackTrace (); Return; }}}}}    

Could it be that your Mac has some system files Have folders created, and now your app is trying to make them abusive?

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -