Question :Why can't a file that contains multiple appended ObjectOutputStreams be
deserialized by one ObjectInputStream? (CoreJava)
Answer :Using the default implementation of serialization, there must be a one-toone
mapping between ObjectOutputStream construction and
ObjectInputStream construction. ObjectOutputStream constructor writes a
stream header andObjectInputStream reads this stream header. A
workaround is to subclass ObjectOutputStream and override
writeStreamHeader(). The overriding writeStreamHeader() should call the
super writeStreamHeader method if it is the first write to the file and it
should call ObjectOutputStream.reset() if it is appending to a pre-existing
ObjectOutputStream within the file.
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Thursday, March 12, 2009
Why can't a file that contains multiple appended ObjectOutputStreams be
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment