[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ObjectInputStream and ObjectOutputStream problems(6)

From: Wu, Gansha
Subject: ObjectInputStream and ObjectOutputStream problems(6)
Date: Mon, 6 Aug 2001 09:57:06 +0800

     I found setBlockDataMode() issues in both ObjectInputStream and 
makes our serialized stream could hardly interoperate with JDK. 
     Java Object Serialization Spec demands "All primitive data written by 
classes is buffered 
and wrapped in block-data records", then the block I/O and direct I/O state 
should be very important to ensure correctly read/write. IMHO, Classpath's use 
DataInputStream to switch is a very clean and clever way, but Classpath's 
of states switch is somewhat confusing. In, there're two 
flags - 
readDataFromBlock and isDeserializing - to control the state switch, that seems 
And when setBlockDataMode() makes a state switch, what should do next must not 
be a 
switch back, but a switch to previous mode. But implementaion here has no place 
previous mode, only isDeserializing has some related but limited meaning.  I 
think we 
should review the code about this, I have a patch to make it work for JDK 
stream to some extent, but it won't be helpful to clean the code.

     BTW, I saw in Classpath's mail achieve there's a discussion about 
"Serialization and 
Sun" early in 1998, and no further discussion by now. When I read the source, 
it seems 
that Classpath is doing the work that makes serialization layout compatible 
with Sun JDK. 
I think it's reasonable when considering interoperable in some areas such as 
RMI. How 
about the decisions and progress?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]