I'm not sure about typescript, sounds like your issue is there because short will always be 2 bytes in length. The method you are using will perform fast but will have a larger memory footprint. You could use a for loop(using BitConverter to get each byte) which will take a little longer(about 2x nano seconds) but memory footprint reports half.