I'm writing a Readonly Stream implementation that wraps an
AssetRepresentation.  The AssetRepresentation.GetBytes method takes an
IntPtr to a buffer as the first argument. Does this mean that I need to call
it like this?:
                public override int Read(byte[] buffer, int offset, int count)
                {
                        //Validation code removed for clarity

                        int bytesRead;
                        // Using a fixed pointer to stop buffer being moved by 
the GC during the
copy
                        unsafe
                        {
                                fixed (byte* pointer = buffer)
                                {
                                        bytesRead = 
(int)AssetRep.GetBytes((IntPtr)pointer, (long)offset,
uint)count,out null);
                                }
                        }
             }

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/AssetRepresentation-GetBytes-unsafe-tp4631209.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to