returned object isn't a Uint8Array, (as stated in docs)
See original GitHub issuei spent some time trying to inflate a compressed binary file.
i took this from the docs…
ungzip(data[, options]) Uint8Array|Array|String
to mean i could do this…
decompressed-data=new Float32Array( Ungzip(compressed-data))
that didn’t work, eventually figured i had to do this…
decompressed-data=new Float32Array( Ungzip(compressed-data).buffer)
ideally the original use would have worked, it would be a simpler, neater, interface, or if not possible then highlighted in the docs that whats returned isn’t actually an ‘real’ ArrayBuffer.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Uint8Array - JavaScript - MDN Web Docs
Chrome Edge
Uint8Array Full support. Chrome7. Toggle history Full support. Edge12...
Uint8Array() constructor Full support. Chrome7. Toggle history Full support. Edge12...
Constructor without parameters Full support....
Read more >Uint8Array to string in Javascript - Stack Overflow
Not sure if it will work, but I use u8array.toString() when reading files from BrowserFS that expose Uint8Array object when you call fs.readFile...
Read more >Uint8Array JavaScript API - JavaScripture
Interactive API reference for the JavaScript Uint8Array Object. Uint8Array is similar to an Array where each item is an 8 bit (1 byte)...
Read more >Uint8Array in js_sys - Rust - Docs.rs
The hasOwnProperty() method returns a boolean indicating whether the object has the specified property as its own property (as opposed to inheriting it)....
Read more >Buffer | Node.js v19.3.0 Documentation
If no character encoding is specified, UTF-8 will be used as the default. ... Creates and returns a new Blob containing a subset...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is just how typed arrays work in js.
And documentation clearly states
Uint8Array
, not anArrayBuffer
.Nope. Please, familiarize yourself with JS and in particular with prototypes.