Write the buffer with the given amount of elements. It gets the element size from the type parameter.
Write the buffer to the underlying stream. Effectively wrapping fwrite.