public T getStruct <T>(int size) where T : new() { byte[] bytes = new byte[size]; int bytesRead = link.getNetworkStream().Read(bytes, 0, bytes.Length); return(ConnectWork.fromBytes <T>(bytes)); }
public T read <T>() where T : new () { T tmp = new T(); byte[] bytes = new byte[Marshal.SizeOf(tmp)]; int bytesRead = wifi.getNetworkStream().Read(bytes, 0, bytes.Length); tmp = ConnectWork.fromBytes <T>(bytes); return(tmp); }