Please support our product enhancement request

And how did you solve the issue with bytes parameter?
Remember: When copying a stream of 200kB, it is not a good solution to copy byte by byte as this would require the loop to run 200000 times. When using the Binary datatype (which is not available in RTC and middle tier anymore) it would be looping 100 times only. The factor for this is 2000 - so it takes 2000 times as long as when using the binary data type.

As we have streams of several megabytes to copy/analyze etc. it would be an enormous break down in performance which I would not like to present to our customers.

Now, I have got first test results for NAV 5.0 SP1 and NAV 2009 (Classic,SQL and RTC):

I tested to split a 200 MB file into 2 parts with 100 MB each, using a call to myCOPYSTREAM(outStream1,inStream,100000000) and a second one to myCOPYSTREAM(outStream2,inStream,100000000) from a NAV codeunit. (as I mentioned above the methods are implemented via COM automation server)
The whole transaction lasted about 5 sec on the classic versions, slightly more on NAV 2009 and about 14 sec on RTC (middle tier). (But I have to say, that I 've got all three tiers running on my computer…) - I made up the tool in Visual C# 2008 Express Edition for .NET Framework 2.0. Unfortunately the IStream.CopyTo method is not implemented in mscorlib, so I had to do it with IStream.Read and IStream.Write, respectively. There is simply one call to IStream.Read/Write with parameters, the number of bytes to read and a byte array address, which had to be allocated before the call (of course reading byte after byte would lead to a breakdown in performance). The tool is also tested now in situations where there are not enough remaining bytes to read. The function simply returns the number of bytes that could be copied. An enhancement would be: if “bytes to copy” is zero than the method should work as the ordinary COPYSTREAM function and copy the whole stream.

For reference I compared the time duration of myCOPYSTREAM with the standard NAV COPYSTREAM function. It turned out that the time to copy a 200 MB file with COPYSTREAM(outStream,inStream) was about 5 sec on my computer, so the performance seems to be comparable with that of pure C/AL code.

You are free to post the code here [:D].

No, seriously - I would be quite interested in the code. I tried a similar thing myself but dide not succeed in casting the NAV streams properly to call automation objects with it.

Sorry, I tried hard, but couldn’t get there even searching by ID number! [:(]

No problem at all - at least somebody has reviewed (and changed the title) of the topic.
I just got a notification from Microsoft

Well, unfortunately the tool uses essential parts of some of our commercial products and I’m not allowed to publish it here. But you can check the tool itself here: http://dynamicsuser.net/media/p/140491.aspx, where I put a test version…

Now, Thomas, as you got the (not too surprising) answer from microsoft: “We will consider this feature for a future release.” - did you already find some time to test the “external component solution” specified above? I think this could be an alternative, …, at least may be for the next two or three years, … whatever the future will deliver…