Well, you know that the first name starts at byte 9, and that the last name ends at byte (lenght-13). What is uncertain is how to find where the first name ends and the last name begins. I see a few possible soutions:
- If the format was defined by a C programmer, the two name fields are most likely terminated by a null byte, since that's the C convention for strings.
- If it was defined by a Java programmer, it could be written by writeUTF(), which means that the specification of the byte count is most likely wrong. However, this at least specifies the encoding, which is otherwise an open question.
- If it was defined by a COBOL programmer, the two fields could be fixed-length and padded with zeroes or spaces, with the format specification listing the payload length rather than the field length.
- If it was defined by a really incompetent programmer (whatever language), it contains the two names without delimiter or count, so it's not possible to realiably separate them (if you don't have the information, there's no "magic" function in Java or elsewhere that can conjure it out of thin air). I suppose you could hope the last name always starts with an uppercase letter and nobody uses double names or all-caps.