Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Null terminated

 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My instructions say:
All numeric values are stored in the header information use the formats of the DataInputStream and DataOutputStream classes. 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. The character encoding is 8 bit US ASCII.
What does "null terminated if less than the maximum lenght for the field".
Does this mean a field that is suppossed to be 64 characters in the file,
may be less and if so it has a null indicator on the end?
If so this screws up my entire process of reading in the file!!!
I read another post regarding this issue but it did not make things
clear for me.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bill null terminated does mean that no matter how long the string actually is, it still takes up the entire space alotted. Meaning if the Name is 64 characters in the data file, then 64 characters are used. This way the record is always "fixed" length.
Mark
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks mark. I have not worked with files for a long long time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic