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 null terminated text fields? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "null terminated text fields?" Watch "null terminated text fields?" New topic
Author

null terminated text fields?

Henry Zheng
Ranch Hand

Joined: Jan 24, 2004
Posts: 60
Hi,

I'm currently working with my assignment, and I got a problem regarding to the format of the text fields in the db file.

My assignment mandates all text fields be "null terminated if less than the maximum length for the field"(directly quoted from instructions).

But when I checked the original db file comes along with the assignment, I found that text fields are padded by spaces.

So should I pad the empty bytes with 0 or with white spaces? And do I need to consider the whitespace padding in the original records part of the fields(which is not sensible) or just rip them off?

Thanks!


Henry Zheng<br /> <br />I went numb when I learned to see.
Omar Kalaldeh
Ranch Hand

Joined: Jun 08, 2004
Posts: 58
Hi Henry,

I think the following link will help you,
URLyBird 1.3.3 data file: Reply from SUN

Padding strings with white spaces is completely accepted by sun, and it is the easiest way.


Best Regards <br /> <br />Omar F. Kalaldah<br />---------------------<br />SCJP, SCJD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: null terminated text fields?
 
Similar Threads
B&S - Some more questions according the database (see third post)
db file: fixed length fields termination characters
Null terminated strings?
NX: URLyBird 1.1.3 Find criteria
Null-terminated data entries.