question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

returned object isn't a Uint8Array, (as stated in docs)

See original GitHub issue

i 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
alexeytencommented, Apr 20, 2020

This is just how typed arrays work in js.

And documentation clearly states Uint8Array, not an ArrayBuffer.

0reactions
alexeytencommented, Apr 21, 2020

your returned object has a property ‘buffer’, an ArrayBuffer, but (see above) Uint8Array’s require it be a property of an objects prototype

Nope. Please, familiarize yourself with JS and in particular with prototypes.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found