Add type-hint to to-byte-array