Two Laptop Bag*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird data file - null terminated Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird data file - null terminated" Watch "URLyBird data file - null terminated" New topic
Author

URLyBird data file - null terminated

Mike Ngo
Ranch Hand

Joined: Oct 16, 2006
Posts: 89
Here is the spec:

"All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field."

But when I check the original file, the strings are not really null terminated but padded with spaces.



So when I write the updated values, should I null terminated them like the spec says or pad them with spaces up to the max. field length?
Sam Codean
Ranch Hand

Joined: Feb 26, 2006
Posts: 194
i too have the same issue. Any Rancher can help??


-Sam Codean<br />SCJP 1.4 (98%)<br />SCJD 5.0 (87.5%)
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 916

Hi,

The null is the "pad" character, if your field value length is smaller then the specified one you must append it with a special character, I call it pad character.

Regards M


SCJP, SCJD, SCWCD, OCPJBCD
Petr Hejl
Ranch Hand

Joined: Feb 26, 2006
Posts: 68
This is not true. The null is terminating (not padding) - written in assignment. In addition the records are padded with spaces, not nulls. This theme was discussed many times. Search for it...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URLyBird data file - null terminated
 
Similar Threads
Null terminated
NX: URLyBird 1.1.3 Find criteria
B&S: Writing of records
Writing into DB File
.db file format problem, help please!!!