Yes I was never writing to disk, that is part of why I am writing this application. It is much faster to do it in memory, turns out the problem was the compression type. When I saved in memory stream I have to tell it to save as jpeg compression, then I can save as dcm and view it in microdicom. Now the issue is I cannot view it in orthanc's web viewer as a pyramid file.
Thank you for your reply.