Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

sreek, Thiru

+ Follow
since Feb 21, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sreek, Thiru

hello Chip here is the solution for ur problem..
the "objectstreamwalker" in this package seems to be more like what u want

-- sreek
21 years ago

Is there any mechanism in java, which enables us to browse into a serialized file and deserialize a specific object???
I some how stored the offsets of diff objects in the serialized file. but when i try to skip through the ObjectInputStream while deserializing it gives me stream corrupted Exception I tried to use skipBytes(), read(),readBytes()... all of them give me
StreamCorrupted Exception: reached EOF in stream... Any info in this aspect would be of great help.
21 years ago
My application needs me to serialize some objects... but when deserializing instead of deserializing the entire file,i should be able to index into the serialized object file and deserialize a specific object. I thught of creating an index with object sizes.
21 years ago
i may not be able to give u a solid answer but... as far as i know when ever a thread looses its control it frees all the locks held by i guess it depends on ur exception handling
thanks for ur help....
i don't think i can implement ur suggestions in my application... it would have been better if we had an easy way to do it.
anyway... thanks a lot
[This message has been edited by sreek, Thiru (edited February 22, 2001).]
21 years ago
Java uses Hex code to write into serialized file... if u have any hex-file editor u can view it... or the usual way is to deserialize the objects in the file and perform get() methods (must be in the class def) to printout the info u want.
hope this would be helpful to u.
21 years ago
hi, I want to know if there is any mechanism in java which gives the byte size of a arbitrary object....
something similar to sizeof() in C(!!!)
21 years ago
Yes , it seems that only because the thread might not have been started yet.. the result is so....
if we introduce sleep of even 1 ms u will get 10.(i ran it so)
i ran it with sleep(0)... it gave me 5.. I wonder what would a thread do for sleep(0)???
I am trying to read a file and skip some bytes ... using "skipBytes" method, but it always skips zero bytes irrespective of what the argument is....
here is the code.
long fp...(from some other method)
fos = new FileInputStream("emp.ser");
bos = new BufferedInputStream(fos);
oos = new ObjectInputStream(fos);
int avail = oos.available();
System.out.println("avail = " + avail);
int b = oos.skipBytes( (int)fp);
if(b != (int)fp )
System.out.println("b =" + b + " & fp = " + fp);
catch( Exception e) { e.printStackTrace(); }

output is :
avail = 0
b=0 & fp = given val
I am striving with this from past 10 to 12 hrs ... someone please help me.
21 years ago
Hello, I am serializing few objects and writing them to a file using "writeObject" method... I want to know if there is any mechanism in Java that allows you to index into this file while deserializing it... ie .. can I somehow index into this file read a specific object?
21 years ago