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.
Is that means while we are writing to the file we need to end a field with null, if less than the maximum length for the field? 2. Also I am using
writeBytes(str);
to write to the file. Is that means my character encoding is 8 bit US ASCII. Thanks in advance Roy.
Satish Avadhanam
Ranch Hand
Joined: Aug 12, 2003
Posts: 697
posted
0
Originally posted by Roy Augustine: Hi all; 1. Assignment says
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.
Is that means while we are writing to the file we need to end a field with null, if less than the maximum length for the field?
Yes. You can either terminate it with null, or pad the rest of the field with space.
2. Also I am using
writeBytes(str);
to write to the file. Is that means my character encoding is 8 bit US ASCII.
It does'n mean any US-ASCII character encoding, probably it may use the default operating system encoding. There is no mention about any encoding for the above method in the API. You may want to search here for "Null Termination" and "character encoding is 8 bit US ASCII". You will get a couple of threads for one and many threads for other which are very useful and makes all clear regarding this encoding and null termination issue.
Thanks in advance Roy.
Good Luck
George Marinkovich
Ranch Hand
Joined: Apr 15, 2003
Posts: 619
posted
0
Hi Roy, Take a look at the String class, specifically
Hi Thanks both for your help. I am going through different threads now. It look like that will help me. I am sorry I didn't search before posting. Regards Roy.