AnsweredAssumed Answered

Trying to extract data from IMemoryBlobStream

Question asked by Holywhippet on Jun 25, 2017
Latest reply on Jun 27, 2017 by Holywhippet

Can someone tell me what I'm doing wrong here:

 

            byte[] inBytes = File.ReadAllBytes("c:\\temp\\NotesRecording.wav");
            IMemoryBlobStream inBlob = new MemoryBlobStreamClass();
            inBlob.ImportFromMemory(ref inBytes[0], (uint)inBytes.Length);
            MessageBox.Show(inBlob.Size.ToString());
            inBlob.SaveToFile("c:\\temp\\blobTest2.wav");
            byte[] outBytes = new byte[inBytes.Length];
            inBlob.AttachToMemory(ref outBytes[0], inBlob.Size, 0);

 

The last part is the problem, I'm trying to extract the data in the blob stream class to a byte array. It doesn't work at all though, the array just remain empty afterwards.

Outcomes