本文整理汇总了C#中NSData.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# NSData.ToArray方法的具体用法?C# NSData.ToArray怎么用?C# NSData.ToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NSData
的用法示例。
在下文中一共展示了NSData.ToArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Clicked
public override void Clicked(UIActionSheet actionview, int buttonIndex)
{
if (buttonIndex == 0)
{
Console.Write("Satya!!!!!!");
/*UIActivityIndicatorView spinner = new UIActivityIndicatorView(new RectangleF(0,0,200,300));
spinner.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
spinner.Center= new PointF(160, 140);
spinner.HidesWhenStopped = true;
actionview.AddSubview(spinner);
InvokeOnMainThread(delegate() {
spinner.StartAnimating();
});
*/
var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);
fileName = documents + "/" + fileName;
data = NSData.FromUrl(_nsurl);
File.WriteAllBytes(fileName,data.ToArray());
if (File.Exists(fileName))
{
UIAlertView alert = new UIAlertView();
alert.Title = "Download Complete";
alert.AddButton("Done");
alert.Show();
}
//spinner.StopAnimating();
}
}
示例2: DidReceiveData
public override void DidReceiveData (NSUrlSession session, NSUrlSessionDataTask dataTask, NSData byteData)
{
var data = getResponseForTask(dataTask);
var bytes = byteData.ToArray();
// NB: If we're cancelled, we still might have one more chunk
// of data that attempts to be delivered
if (data.IsCompleted) return;
data.ResponseBody.AddByteArray(bytes);
}
示例3: GetStringFromNSData
private string GetStringFromNSData(NSData data)
{
return Encoding.Unicode.GetString(data.ToArray());
}