probably a very simple solution to this.
I am implementing the upDateRecord() method in the Data class.
I am passing a
String array holding the record fields to update, and using a Random-Access file stream to write the fields.
I have found a
thread advising the use of writeByte(), and write(Byte[]).
I am converting each strings in the fields array to Byte[], then writing these to the datafile. Problem is the Byte[] to write has to be exactly the size dictated by the database schema to keep the structure of the database.
How is a string (shorter than say 32 bytes) which is converted to byte[] padded to 32 bytes ensuring no garbage is left in the field from a previous value. Is there another easier way of doing this simple task.
Hope the above long winded description makes sense.