format: New method on TextRecord

This commit adds a toByteArray() method to the TextRecord byte[]
container. The new method quickly returns with content if there are no
trailing bytes, otherwise it concatenates the two arrays.