ArrayBuffer is a Javascript data type used to represent a generic, fixed-length binary data buffer.
Questions tagged [arraybuffer]
597 questions
9
votes
2 answers
Using ajax to send a Proto-buf message to a Java server
Using https://github.com/dcodeIO/ProtoBuf.js/ I encoded a message I want to send to a java server to a ByteBuffer called batch:
batch:
ByteBuffer {array: ArrayBuffer, view: DataView, offset: 0, markedOffset: -1, length: 139…}
array:…

Jason S
- 137
- 2
- 9
9
votes
3 answers
Partial XHR response reading for binary data, possible?
I am currently researching the possibility of reading partial XHR responses with binary data. Our current approach is based on the 'responseText' property and base64 encoding. Clearly, this is far from optimal.
How could we read partial…

bjornl
- 1,757
- 3
- 17
- 29
8
votes
2 answers
Saving ArrayBuffer in IndexedDB
How can I save binary data (in an ArrayBuffer object) into IndexedDB?
The IndexedDB spec doesn't mention ArrayBuffer - does that mean that is not supported (and I have to pack ArrayBuffer as a string or a an array?).

Mortennobel
- 3,383
- 4
- 29
- 46
8
votes
2 answers
How to Convert UTF8 ArrayBuffer to UTF16 JavaScript String
The answers from here got me started on how to use the ArrayBuffer:
Converting between strings and ArrayBuffers
However, they have quite a bit of different approaches. The main one is this:
function ab2str(buf) {
return…

Lance
- 75,200
- 93
- 289
- 503
8
votes
0 answers
HTML5 video stream arrayBuffer
Server sends video as arrayBuffers and streams them to client using websockets.
On the client side i receive arrayBuffers in real time. So, is there any way to launch video stream using these arrayBuffers via HTML5 video tag?
Example of…

Vladyslav Hrytsenko
- 103
- 1
- 7
8
votes
1 answer
Converting ArrayBuffer to String then back to ArrayBuffer using TextDecoder/TextEncoder returning a different result
I have an ArrayBuffer which is returned by reading memory using Frida. I'm converting the ArrayBuffer to a string, then back to an ArrayBuffer using TextDecoder and TextEncoder, however the result is being altered in the process. The ArrayBuffer…

Hem
- 685
- 1
- 8
- 14
8
votes
2 answers
Angular 4.3: Getting an arraybuffer with new HttpClient
I would like to change to the new HttpClient. Until now I handle file downloads the following:
getXlsx (): Observable {
return this.http.get('api/xlsx', {
responseType: ResponseContentType.ArrayBuffer, // set as ArrayBuffer instead of…

Luke
- 185
- 1
- 3
- 16
8
votes
5 answers
Convert ArrayBuffer response to JSON
Here I am calling a GetFile , getting response as ArrayBuffer{} object, In network Tab response is {"errors":["photoProof Image is not available in the system"]}, if I do response.errors=undefined.
$scope.getDocuments = function(){
…

Vishnu
- 455
- 2
- 7
- 25
8
votes
1 answer
using zip.js to read a zip file via xmlhttp/ajax call on Node.js
I am trying to :
Send a zip file via xmlhttp to the client
then read the file using zip.js and render its contents
I successfully receive the binary of the file i.e. the success callback is called but I get and error when I try to do getEntries. …

Rishul Matta
- 3,383
- 5
- 23
- 29
8
votes
6 answers
Do ArrayBuffers have a maximum length?
I little confused here. Do ArrayBuffer allocate a new memory region for it?
If so, what would be the safe maximum Blob size to put on it?

cavila
- 7,834
- 5
- 21
- 19
7
votes
1 answer
How to convert fetch response to array buffer?
Using a library like axios I can request data from a http request as an array buffer:
async function get(url) {
const options = {
method: 'GET',
url: url,
responseType: "arraybuffer"
};
…

Oamar Kanji
- 1,824
- 6
- 24
- 39
7
votes
1 answer
Is copying a large blob over to a worker expensive?
Using the Fetch API I'm able to make a network request for a large asset of binary data (say more than 500 MB) and then convert the Response to either a Blob or an ArrayBuffer.
Afterwards, I can either do worker.postMessage and let the standard…

bitsoverflow
- 556
- 5
- 15
7
votes
0 answers
Trim or cut audio recorded with mediarecorder JS
Requested Knowledge
How to shorten (from the front) an array of audio blobs and still have playable audio.
Goal
I am ultimately trying to record a continuous 45 second loop of audio using the JS MediaRecorder API. The user will be able to push a…

Brendon Pierson
- 81
- 1
- 6
7
votes
2 answers
Converting ArrayBuffer to int in Javascript
I am trying to convert an ArrayBuffer to an int using JavaScript. My app uses WebSocket and on the Sender side I have an integer between 0 and 4. I convert this ArraySegment in C#. I send this via web sockets to my JavaScript client which receives…

Andrew Simpson
- 6,883
- 11
- 79
- 179
7
votes
1 answer
sending a png image over a websocket and rendering the received image
On server:
I am loading a png image:
var myimage = png.load('test.png');
then sending over websocket connection:
ws.send(myimage);
On client:
function onMessage(evt) {
if (evt.data instanceof ArrayBuffer) {
var length =…

user1364297
- 141
- 1
- 2
- 6