Exemplo n.º 1
0
 public T GetValue <T>() where T : struct
 {
     unsafe
     {
         fixed(byte *ptr = Value)
         return(FastStruct <T> .ArrayToStructure(ref ptr[0]));
     }
 }
Exemplo n.º 2
0
        public static T Read <T>(this BinaryReader reader) where T : struct
        {
            byte[] result = reader.ReadBytes(FastStruct <T> .Size);

            return(FastStruct <T> .ArrayToStructure(result));
        }