Convert C# function to Elixir

Your content variable is already a Binary (an Elixir string is a Binary) so it is already “bytes”.

Your code looks complete to me. Where are you having problems?