Yes its valid. Because its essentially the same thing going on "under the hood".
But you have to make sure the external function ONLY accesses the correct ammount of bytes, or it will lead to unpredictable behavior.
But you have to make sure the external function ONLY accesses the correct ammount of bytes, or it will lead to unpredictable behavior.