Question :Why is UTFDataFormatException thrown by DataOutputStream.writeUTF()
when serializing a String? (CoreJava)
Answer :DataOutputStream.writeUTF() does not support writing out strings larger
than 64K. The first two bytes of a UTF string in the stream are the length
of the string. If a java.lang.String can be larger than 64K, it needs to be
stored in the stream by an alternative method rather than depending on
the default method of storing a String in the stream, writeUTF.
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 is UTFDataFormatException thrown by DataOutputStream.writeUTF()
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment