610 questions
1
vote
1
answer
84
views
Does worker_threads MessagePort transfer fail silently with detached ArrayBuffers in certain V8 optimization scenarios?
I'm building a high-performance image processing pipeline using Node.js worker_threads. I'm transferring large ArrayBuffers between workers using postMessage with the transfer list.
In production (...
2
votes
2
answers
281
views
Type narrowing of Uint8Array<ArrayBufferLike> to Uint8Array<ArrayBuffer>
Since TypeScript 5.9 we have (roughly speaking) Uint8Array = Uint8Array<ArrayBufferLike> = Uint8Array<ArrayBuffer | SharedArrayBuffer>. Now I am looking for a clean and idiomatic way to ...
0
votes
1
answer
62
views
Text clipped at 37kb when trying to make blob or arraybuffer and upload to sharepoint
I am trying to upload json data as a text file to SharePoint with javascripts stingify method using either blob or array buffer, but I keep getting only the first 37kb of the content saved. This is ...
1
vote
2
answers
236
views
What results in TextEncoder.encode() using a buffer of a given type?
The return value of TextEncoder.encode() is Uint8Array<ArrayBufferLike>. The ArrayBufferLike type includes ArrayBuffer and SharedArrayBuffer. How to know which type of array buffer encode() will ...
2
votes
2
answers
362
views
Blob could not be loaded from a localhost as src blob:
I'm having some trouble loading an audio file in WAV format returned from the backend as a Blob in Angular.
I have in my services the following:
getFileBlob(uniformName: string, path: string) {
...
1
vote
2
answers
176
views
Correct use of getUint16()
How to properly access the elements in data views based on the data type?
Consider the following example code:
const data = new Uint16Array([7, 12, 100]);
const view = new DataView(data.buffer);
...
1
vote
1
answer
213
views
Checking if AudioBufferSourceNode has already started
My problem lies in a series of audiobuffersource calls and starting. I have successfully implemented pauses in the middle of an audioBuffer by stopping the audioNode and calculating the elapsedTime to ...
4
votes
2
answers
3k
views
Error: Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supported in ReactNative
I'm encountering an error while working on my React Native application.
When I attempt to transform the HTML content of a page into a PDF for export and client email, I receive the following error:
...
0
votes
1
answer
480
views
Memory usage too high when working with large JS ArrayBuffers
I'm writing some browser code with a lot of large ArrayBuffers. I noticed the memory consumption is unexpectedly large and I'm not sure why that is. I've never worked with ArrayBuffers before and I ...
1
vote
0
answers
77
views
Tracking NodeJS "arrayBuffer" allocations
There are many options for heap profiling in NodeJS, but I'm having trouble finding anything to profile the memory returned by process.memoryUsage().arrayBuffers.
So far the only approach I've found ...
0
votes
2
answers
156
views
Multple files zipped & uploaded at the same time without causing memory overflow
In my app (Laravel + Inertia + Vue3) user selects multiple files using input. I need to compress them into zip and upload to server in chunks for further operations.
I tried using JSZip library, but ...
0
votes
1
answer
162
views
cbor.js decodes BYTES to associative object instead of Array/TypedArray
I have a CBOR payload containing a MAP with a BYTES field:
// simplified testcase:
var data = [0xBF, 0x63, 0x72, 0x61, 0x77, 0x58, 0x10, 0x00,
0xFF, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xFF, ...
3
votes
1
answer
1k
views
docx.js: How to use document patcher on client side
I'm trying to generate docx file using the docx javascript library but only on the client side.
The generation of new documents works like charm, but I would like to patch a document using the patcher....
0
votes
0
answers
51
views
Docker app gives ERR_SOCKET_CONNECTION_TIMEOUT when use ArrayBuffer in Axios or fetch method
I am getting a strange issue with docker. When I use axios / fetch method to get data from an API with that return the arrayBuffer My axios gives error ERR_SOCKET_CONNECTION_TIMEOUT.
Same things works ...
0
votes
0
answers
51
views
Ask how to resolve persistent high memory usage when reading files from ArrayBuffer in web application
You've written logic to convert a file to an ArrayBuffer and process it when the user selects it via a file picker. Initially, you tried to do this using the FileReader API, but you ran into an issue ...
0
votes
1
answer
58
views
Codeigniter Downlaod Helper not working for Zip files
I am trying to download a file saved in the server and allow the user to extract it from the front end based on the date selected. The application is built using the codeigniter framework.
I am ...
0
votes
1
answer
320
views
Convert ArrayBuffer to AudioBuffer
I'm want to record audio from browser using MediaRecorder convert the same into AudioBuffer to send it to server. It returns the first chunk as AudioBuffer but for subsequent chunks it is throwing the ...
1
vote
1
answer
138
views
Decode BLE Glucometer characteristics value
I am using a BLE device to read glucose value and get it on my system, but
I am stuck on how to parse the encoded value returning from the glucometer characteristics value.
for eg: I am getting [27, ...
0
votes
1
answer
338
views
In a NodeJs code with (Array)Buffers, native readUInt16BE is used but my context is a browser so i want to use use DataView.getUint16 instead
I came across a JPEG parsing function in Node.js that I'm attempting to adapt for use in a browser environment. The original code can be found here.
The original code uses Node.js' Buffer class. As i ...
0
votes
2
answers
524
views
Decode BLE Temperature characteristics value to Celsius
I am using a BLE device to read temperature and get it on my system, but
I am stuck on how to parse the encoded value returning from temperature characteristics value.
for eg: I am getting BmsBAP/...
0
votes
1
answer
1k
views
Reuse arrayBuffer for fetch response
I use fetch API to perform HTTP requests. Because the HTTP response body is a binary, I use response.arrayBuffer() method to get the result as bytes.
Anyway, this approach doesn't perform well when ...
0
votes
1
answer
204
views
ws: Recieve data from client as ArrayBuffer
I am using the ws library in nodejs to create a little cursor lobby with other players. I have successfully implemented using the server to send ArrayBuffers with bit streams to the client, and also ...
0
votes
1
answer
978
views
add pasted image in a docx file by docxtemplater-image-module-free
I want to make a local web page that accept users' pasted image and add to a docx file. To achieve this, I decided to use docxtemplater.js and docxtemplater-image-module-free module, but I can't get ...
3
votes
1
answer
278
views
Memory allocated for resizeable Javascript ArrayBuffer
When you initialize an ArrayBuffer with maxByteLength to make it resizeable, are maxByteLength bytes reserved in memory up front so that the ArrayBuffer can grow in contiguous memory space?
Or is a ...
0
votes
1
answer
214
views
ArrayBuffer to QByteArray conversion failes for QT 6.5.2
In following code snippets, I try to transfer an ArrayBuffer from QML to a C++ handler, where it is supposed to get converted into a QByteArray. This is working in QT 6.5.1 but stopped working in 6.5....
1
vote
2
answers
636
views
What I have to do when I need to encode the file to base64 but `ProgressEvent.target.result` is null or has `ArrayBuffer` type?
According to TypeScript types definitions, the type of ProgressEvent.target.result could be string, ArrayBuffer or null.
What I need is, the function which encodes the file to base64 which is type ...
0
votes
1
answer
658
views
I created a new file using arrayBuffer, but it is different from the original file. How can I make a file identical to the original one?
uint8 is an arrayBuffer created using reader.readAsArrayBuffer from an image file. The size of this arraybuffer is 30984. The size of the original image file is also 30984.
However, if you create a ...
0
votes
0
answers
145
views
Trying to upload video from a web app to Google Drive but getting zero bytes due to incorrect binary data
The purpose of the code is to upload files to Google Drive from a web app programmatically using JavaScript. The part that uploads documents is working okay, but the video part is still not working. I ...
0
votes
1
answer
1k
views
why does a Uint8Array() from buffer returns empty?
I am trying to load a font for pdf-lib to use. In order to use it, i must provide a Uint8Array for pdfDoc.embedFont(font);
For some reason, whenever i create the UInt8Array, it returns empty. The ...
2
votes
0
answers
595
views
file handling on node js which is better FileReader or Buffer.from(arrayBuffer)
which is more efficient on nodejs server
1)
let file :File = (await formData()).get('input-png')
let arrayBuffer = file.arrayBuffer()
buffer = Buffer.from(arrayBuffer)
2)
let file :File = (await ...
1
vote
2
answers
4k
views
Converting huge JSON object to Blob by stringifying "directly into" an ArrayBuffer/Blob to avoid maximum string length error
Context:
I have some code like this in my application:
let blob = new Blob([JSON.stringify(json)], {type: "application/json"});
However, it sometimes fails because in Chrome the maximum ...
0
votes
1
answer
2k
views
Convert Binary File Data To ArrayBuffer Sent From Python As Byte-Array String
I'm developing a Python App which uses PyQt5 and PyQtWebEngine to create a browser window. Using QWebChannel I'm able to send strings back and forth between the Web Application and the Python program. ...
1
vote
2
answers
171
views
How to read 12bit unsigned integers from a raw data file into UInt16Array in JavaScript?
So I have a file which contains values of 12 bit unsigned integers. I have no problem reading the file directly into a UInt8Array or UInt16Array but the values are of course incorrect and the length ...
0
votes
1
answer
1k
views
How to download response type document with axios on front-end application?
I am trying to get file from api (docx, odt) and save it to downloads (this is frontend app). I'v tried postman 'Save response to file' and it works ok, file saved as i expected.
What should I do in ...
0
votes
2
answers
2k
views
What is the best way to send array buffer from React client to C# server?
I have an array buffer that created from pdf file, I have to send that data to the server side. What is the type C# may want to get? What type should I send from the client side? not sure what is the ...
0
votes
1
answer
374
views
How do I check if a value is a `SharedArrayBuffer` view, in Javascript?
The ArrayBuffer.isView() static method checks if it's one of the ArrayBuffer views, such as TypedArray objects or a DataView.
How do you check if it's a view of a SharedArrayBuffer?
It's been a quite ...
1
vote
1
answer
2k
views
how i could make html2pdf.js return pdf to be a blob and send it for array buffer
I have been working with html2pdf.js library to convert the HTML content to PDF and add my own custom header and footer on each page while converting. This actually works for me, but I couldn't pass ...
1
vote
0
answers
386
views
Really confused with byte stream, Unit8Array, arrayBuffer, node stream, etc
First of all, I clearly know what node.js stream is.
Node.js stream is used when I need a way to serve data in chunks, piece by piece, to the memory, instead of loading the entire content of a file ...
1
vote
0
answers
930
views
What's the easiest way to convert ogg to webm on Node without ffmpeg?
I'm working on a Telegram bot that can receive voice messages and then let OpenAI's Whisper transcribe them and then respond using OpenAI's chat completions API.
Anyway, Whisper does accept a webm ...
1
vote
1
answer
2k
views
How to Get Response Body as Array Buffer using HTTPS module in Node.js?
I am trying to fetch an image using the native node.js https module and receive the response body as an array buffer.
With axios, you can simply do this:
axios.get('https://placehold.co/600x400', { ...
-1
votes
1
answer
897
views
load OBJ file from blob in three.js
I'm trying to load an OBJ file from a blob with three js.
I've referred to this and got STLs to load. But it's not working for OBJs.
The error I'm getting is:
TypeError: text.indexOf is not a function
...
0
votes
0
answers
38
views
Decoding ArrayBuffer(5) from COMARK BT42
I am trying to read the temperature from a Comark BT42. The temperature can be retrieved from the device as an arraybuffer. However trying to turn that into a float has some odd results. My app is ...
1
vote
0
answers
58
views
Can't Get Data from MediSource Stream when get data in middle of streaming
I'm working on a live video streaming service. I get data from the camera and turn the binary array to base64 and send base64 strings to other clients. in the receiver part, I'm using Mediasource API ...
0
votes
3
answers
166
views
How to send the output of the FOR loop as the input to itself in Scala?
Add elements to the array buffer such that the element to be added is the product of the previous two elements of the input array buffer. The elements in the output array buffer should not exceed ...
0
votes
1
answer
240
views
TypeError when using writeFile of arraybuffer image data type
I'm getting an error when I'm trying to write a file with PNG data.
var png = UPNG.encode([data], width, height, 0);
var file = fs.writeFile("mypng.png", png);
Error:
[TypeError: The "...
0
votes
0
answers
1k
views
What is this structure coming from a fetch that returns a octet-stream?
I'm tring to retrieve a list of files from an API using axios, in Node.js. What I get is what I assume is an ArrayBuffer string. I'm using the following code:
axios.get('http://api.com/filesList')....
3
votes
1
answer
1k
views
Fetch raw gzip-encoded web page into Uint8Array
I'm using fetch to retrieve a URL. This is in code that is acting as a proxy and if it gets a response with content-encoding: gzip, I want to get the raw data so I can send it back to the consumer ...
2
votes
1
answer
3k
views
React Image: createObjectURL link gives error 404 (Not Found)
I created an ImageUrl using the following code in React with Typescript. It made a URL, however does not show a picture image. Clicking on the URL eg "http://localhost:3003/0b4de100-d8eb-49a7-...
2
votes
1
answer
2k
views
Audio not playing in Safari for macOS/iOS
I'm using googles text-to-speech api on the backend, and sending to the frontend in the form of an ArrayBuffer. It then gets converted to a url that played with audio.play() This is working on chrome ...
0
votes
0
answers
167
views
RangeError: Failed to execute 'compressedTexSubImage2D' on 'WebGl2RenderingContext': The ArrayBuffer/ArrayBufferView size exceeds the supported range
I am currently working on a multiplayer casino game. In the game, there is a poker game and after playing 4 rounds of it I was getting this error but when I reduced or compressed the textures now I am ...