File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird data file - null terminated" Watch "URLyBird data file - null terminated" New topic

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: 918


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

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:
subject: URLyBird data file - null terminated
It's not a secret anymore!