remove unused CastToStruct function
This commit is contained in:
parent
be6682e8c3
commit
3f1c878318
@ -149,20 +149,6 @@ namespace LibTSforge
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static T CastToStruct<T>(this byte[] data) where T : struct
|
||||
{
|
||||
GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned);
|
||||
try
|
||||
{
|
||||
IntPtr ptr = handle.AddrOfPinnedObject();
|
||||
return (T)Marshal.PtrToStructure(ptr, typeof(T));
|
||||
}
|
||||
finally
|
||||
{
|
||||
handle.Free();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class FileStreamExt
|
||||
|
Loading…
x
Reference in New Issue
Block a user