NumberEncoder/NumberDecoder with API similar to TextEncoder/TextDecoder.
let number = ...;
let encoder = new NumberEncoder("Int16");
let bytes = encoder.encode(number);
let bytes = ...;
let decoder = new NumberDecoder("Float64");
let number = decoder.decode(bytes);
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
- http://www.ecma-international.org/ecma-262/6.0/#sec-typedarray-objects
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
- http://www.ecma-international.org/ecma-262/6.0/#sec-arraybuffer-constructor