Reputation: 331
To convert UInt32, Int32 and Float32 to bytes (and vice versa), I'm using DataView.
I was asking myself what is the type of the corresponding bytes : Int8 or Uint8 ?
I would say Uint8 for Uint32 and Int8 for Int32, but what about Float32 ?
Upvotes: 0
Views: 603
Reputation: 33658
DataView doesn't "convert UInt32, Int32 and Float32 to bytes", it converts JavaScript Numbers to bytes in UInt32, Int32, and Float32 formats. How the bytes are stored in a DataView and the underlying ArrayBuffer is an implementation detail.
Upvotes: 1