Hi,
I'm trying to compress an object using gzip but i get this error when i want to read in the data:
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
at java.io.ObjectInputStream.<init>(Unknown Source)
this is the code:
GeSHi (java):
System.
out.
println(ois.
readObject());
Created by GeSHI 1.0.7.20
And this is how i write out the data
GeSHi (java):
out.writeObject(img);
out.close();
Created by GeSHI 1.0.7.20
output:
java.io.ObjectOutputStream@ef22f8
java.io.ObjectOutputStream@1ffb8dc
java.io.ObjectOutputStream@54172f
writing seems to work but i don't know how to read it back in. Gzip seems to be the best solution to compress an single object but if there is a better way let me know.