What’s the difference between File.WriteAllBytes and FileStream.Write/WriteBytes? I have a bitmap object that and I want to create a new bmp/jpg/png on disk. I think I read somewhere that WriteAllBytes uses FileStream.Write underneath?
What’s the difference between File.WriteAllBytes and FileStream.Write/WriteBytes? I have a bitmap object that and
Share
WriteAllBytesis just a convinience method, that wraps the underlyingStreamoperations. (Create a file, write to stream, close stream, etc). Use it if it fits your needs. If you need more control on the underlying operations, fallback to using aStreamor similar.It is all about using the right abstraction for the task.