File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Data update/retrieve format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Data update/retrieve format" Watch "Data update/retrieve format" New topic
Author

Data update/retrieve format

Surya Kumar
Ranch Hand

Joined: Aug 21, 2004
Posts: 52
i am using a string buffer for updation. For a field 'a' with length 10 and content 'TEST'i 'll be storing TEST\x0000\x0000\x0000\x0000\x0000\x0000. But when retreiving i am taking TEST\x0000\x0000\x0000\x0000\x0000\x0000 but trimming the data and using it. Is it ok or not ok as per the null termination of strings is concerned.


Regards<br />Prem<br />SCJP, SCJD, SCWCD, SCBCD, SCEA, SCJDWS
Anton Golovin
Ranch Hand

Joined: Jul 02, 2004
Posts: 476
Originally posted by Surya Kumar:
i am using a string buffer for updation. For a field 'a' with length 10 and content 'TEST'i 'll be storing TEST\x0000\x0000\x0000\x0000\x0000\x0000. But when retreiving i am taking TEST\x0000\x0000\x0000\x0000\x0000\x0000 but trimming the data and using it. Is it ok or not ok as per the null termination of strings is concerned.


IMHO, if your provided data file does not have null termination, it is not necessary. The requirements say of a different application that also accesses this data file. Since it was provided to you without null termination, it is safe to assume that is how that other application uses it. But of course it is a good candidate to be described in choices.txt.


Anton Golovin (anton.golovin@gmail.com) SCJP, SCJD, SCBCD, SCWCD, OCEJWSD, SCEA/OCMJEA [JEE certs from Sun/Oracle]
 
Don't get me started about those stupid light bulbs.
 
subject: Data update/retrieve format
 
Similar Threads
Java PDF testing
Struts and cactus please help
Programatically loading a data jar into the classpath
Button Tag
Printing unicode character