Of course, the msarchet clause also makes copies. You are only talking about how .NET thinks about the memory area if you do not want to copy.
But I do not think that what you want is possible, since bytes and floats appear completely different in memory. A byte uses only bytes in memory, but a float uses 4 bytes (32 bits).
If you do not have memory requirements for storing your data, simply present the data as the type of data that you will use most in memory, and convert the values ββthat you use when you use them.
How do you want to convert a float (which can represent a value from Β± 1.5 Γ 10-45 to Β± 3.4 Γ 10 ^ 38) into a byte (which can represent a value from 0 to 255)?) P>
(more about her:
More about floating types in .NET here: http://csharpindepth.com/Articles/General/FloatingPoint.aspx
source share