a) Any exceptions raised in the database.createRecord() will require to be wrapped up in DuplicateKeyException ?
To interpret the string data you need to use getByte() method of string class, which gives you array of bytes and then you know what to do with it
Why wasn't the parameter just an array of byes !!.
Ok so if I treat the parameter as an array of bytes, is the structure of the array of bytes as follows :-
0 - 31 Subcontractor name ( 32 bytes )
32 - 95 location ( 64 bytes )
96 - 160 specialities ( 64 bytes )
161 - 167 size ( 6 bytes )
168 - 176 rate ( 8 bytes )
177 - 185 owner ( 8 bytes )
So you can do two things:
1. You can just accept the butes array as parameter and it will be upto the future programer to suppy that byte array(Thinking it a real life scenario)
2. You can accept String array and do the work, in which case future enhancements won't require much of work or thinking, the future program will just pass get the string from the user, put it into array and pass it to your create method.
FROM Requirements: 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.
Not only you have to pad the array according to the data file schema but as per requirements you have to null terminate every field if it is less than the total length.
FROM ASSIGNMENT: The company's IT department has a data file that contains the essential information for the company, but because the data must continue to be manipulated for reports using another custom-written application, the new system must reimplement the database code from scratch without altering the data file format.