Question: I have a binary data in c++ variable buffer as below:

```
int len = 39767;
uint16_t * buffer = (uint16_t) malloc(len);
FILE * fp = fopen("rahul.jpg", "rb"); // size of file is 39767 byte.
fread(buffer, len, 1, fp);
fclose(fp);
fp = fopen("rahul3.jpg", "wb");
fwrite(buffer, len, 1, fp);  // Here it is written correct.
fclose(fp);

```

I want to pass this buffer to Node.js and write to a file. I used below line to convert it to Local and then wrapping to an Object:

```
Local<String> str = Nan::New(buffer).ToLocalChecked();
return scope.Escape(str);

```

But, in node.js when I am checking length of received data it prints 9 only and value seems corrupted.

```
console.log(data);
console.log("len = " + data.length );
fs.writeFileSync('rahul2.jpg', data, 'binary');

```

Here rahul2.jpg is corrupted and is of 9 bytes only. How can we get rahul2.jpg from node.js code same as rahul.jpg in c++? Which Nan::New() we should use to pass binary data unaffected? Please help. Thanks.

Answer: 
In your html have an empty span/div with aria-live="assertive". In your button click function, add the text you want the reader to announce to that span.

(This is the same function where you will be taking focus to that section.)

Don't forget to empty it outside the function to make it announce properly next time also.

Aria-assertive text will be announced each time it is changed.

Eg.
In HTML

```
<span id="announce" aria-live="assertive"></span>
<button id="btn">Click</button>

```

In javascript

```
$("#btn").click(function(){
$("#announce").text("Scrolled to a new section");
});

```
This is about focus management. You need somewhere to anchor focus that makes sense to the user and you need to then move that focus.

This is not an ideal solution overall, but lacking context for the larger objective I'll give you the bits to get this part functional / useful.

First, add this style so you can see where the focus is going (you can remove/change it later):

```
*:focus {
  outline: 2px solid #f00;
}

```

Now as you tab through the page you can see where the focus lives.

Then in your script where you create the new form (I recommend you actually just hide this section and display it instead of writing it in via JS, but I understand this may be a demo), update the `<h3>` to be focusable by adding an `id` attribute and then a `tabindex` so that you can drop focus on it. I use the `<h3>` you already have since it provides the context for the user and in this case overrides my general distaste for using `tabindex` on non-interactive elements.

```
<h3 id="second" tabindex="0">

```

Then add bit of script after your `setTimeout()` that moves the focus to that element (thereby ensuring it has been rendered and can receive focus):

```
var secondForm = document.getElementById('second');
secondForm.focus();

```

Now when you click the "Continue!" button, the page scrolls and the heading will receive focus, get announced (you can add instruction text, etc), and the user may continue.

You will probably need to massage the script a bit, maybe stuffing it in its own timer function to be certain it only fires when you want, but overall the general concept is in there.

I [made a pen to demo it](http://codepen.io/aardrian/debug/AXRROo).