You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Don Coleman <do...@gmail.com> on 2015/02/11 02:28:17 UTC

ArrayBuffers in WP8 Plugins

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

Posted by "Sergey Grebnov (Akvelon)" <v-...@microsoft.com>.
Another two examples examples:
https://github.com/sgrebnov/BluetoothSerial/blob/master/src/wp/Bluetooth.cs#L549 
List<byte> data = JsonHelper.Deserialize<List<byte>>(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.Deserialize<byte[]>(data) :
                                     System.Text.Encoding.UTF8.GetBytes(data);

Thx!
Sergey
-----Original Message-----
From: iclelland@google.com [mailto:iclelland@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 <do...@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

Posted by Ian Clelland <ic...@chromium.org>.
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 <do...@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);
>