RE: ArrayBuffers in WP8 Plugins

2015-02-11 Thread Sergey Grebnov (Akvelon)
Another two examples examples:
https://github.com/sgrebnov/BluetoothSerial/blob/master/src/wp/Bluetooth.cs#L549
 
Listbyte data = JsonHelper.DeserializeListbyte(args[0]);
..
dataWriter.WriteBytes(data.ToArray())

https://github.com/apache/cordova-plugin-file/blob/master/src/wp/File.cs#L884
byte[] dataToWrite = isBinary ? JSON.JsonHelper.Deserializebyte[](data) :
 System.Text.Encoding.UTF8.GetBytes(data);

Thx!
Sergey
-Original Message-
From: iclell...@google.com [mailto:iclell...@google.com] On Behalf Of Ian 
Clelland
Sent: Wednesday, February 11, 2015 6:37 PM
To: dev@cordova.apache.org
Subject: Re: ArrayBuffers in WP8 Plugins

The File plugin should have that -- spec test 104 tests calling
FileWriter.write() with an ArrayBuffer as an argument.

The write() method in File.cs looks like it uses JSON.JsonHelper.Deserialize to 
deserialize it, though -- you might have to dig into the bridge to see exactly 
how and where it gets encoded in the first place.


On Tue, Feb 10, 2015 at 8:28 PM, Don Coleman don.cole...@gmail.com wrote:

 Are there any examples of deserializing arraybuffers in WP8 plugins?

 I'm looking for the WP8 equivalent of Android's byte[] data = args.
 getArrayBuffer(3);



Re: ArrayBuffers in WP8 Plugins

2015-02-11 Thread Ian Clelland
The File plugin should have that -- spec test 104 tests calling
FileWriter.write() with an ArrayBuffer as an argument.

The write() method in File.cs looks like it uses
JSON.JsonHelper.Deserialize to deserialize it, though -- you might have to
dig into the bridge to see exactly how and where it gets encoded in the
first place.


On Tue, Feb 10, 2015 at 8:28 PM, Don Coleman don.cole...@gmail.com wrote:

 Are there any examples of deserializing arraybuffers in WP8 plugins?

 I'm looking for the WP8 equivalent of Android's byte[] data = args.
 getArrayBuffer(3);



ArrayBuffers in WP8 Plugins

2015-02-10 Thread Don Coleman
Are there any examples of deserializing arraybuffers in WP8 plugins?

I'm looking for the WP8 equivalent of Android's byte[] data = args.
getArrayBuffer(3);