Embedding U3D files in PDF (in memory)

I tried to use a MemoryFilter object to read a U3D file into memory so
it can be embedded in the document using a FilterReader

In C# I have the following code snippet

---8<----
FileInfo u3d_file_info = new FileInfo( u3dFileName ); MemoryFilter
u3d_file = new MemoryFilter((int)u3d_file_info.Length, true);

u3d_file.Begin();

FilterReader u3d_reader = new FilterReader(u3d_file); u3d_data_dict =
doc.CreateIndirectStream(u3d_reader);
u3d_data_dict.Put("Subtype", Obj.CreateName("U3D"));
----8<----

But I get a compile error for the .Begin() call.

D:\data\playpens\pdfgen\PDFGen\PDFGen.cs(810,17): error CS0570:
'pdftron.Filters.Filter.Begin()' is not supported by the language

I tried GetBuffer() too and it gave the same compile error.
----
A:

A simpler way to load the file in memory is as follows:

FileStream filestm = new FileStream("my.u3d", FileMode.Open,
FileAccess.Read);
BinaryReader reader = new BinaryReader(filestm);
byte[] buff = reader.ReadBytes((int)reader.BaseStream.Length);
Obj u3d_data_dict = doc.CreateIndirectStream(buff);
...
u3d_data_dict.Put("Subtype", Obj.CreateName("U3D"));
...

It is still possible to use MemoryFilter, but you will need to access
unmanaged memory, change security permissions, etc.

Please let me know if this helps and if you have any questions.