I know that I can read the whole file into a byte array and then convert the array to a stream using the following two lines:
But this is not efficient for my code (my code should be very fast and memory efficient). Is there any way to do this straight away without a conversion? or any other better way?
Code:
byte[] fileInBytes = File.ReadAllBytes(Filename); Stream fileInStream = new MemoryStream(fileInBytes);
Comment