vjeux/jDataView — pull request #33 by RReverser (2013-03-15 13:15:40+00:00)
Title: Bunch of performance improvements (and not only)

Now using `String`->`Array`->(`Buffer`|`ArrayBuffer`) conversion chain for best performance on used platform.

`String` buffers are now implicitly converted to inner byte buffer formats too:
* for **getters**, this means no need to convert chars to bytes on each read access;
* for **setters**, this means no need to rebuild strings using `slice`+`concat` on each write access (since JS `String`s are immutable and it was the only way for modifying their contents).

Typed arrays are now used *(when available)* even if values are misaligned and/or they are encoded in Big-Endian mode (operating on sliced part of byte buffer in that case; gives better performance due to using native encoding/decoding functions).

Extended supported input buffer types to `String` + any `Array`-like byte storage (`Array` itself, `Uint8Array`, function `Arguments` object, `jQuery`(`Array`), etc.)

Added `jDataView.wrapBuffer` function for converting any supported input buffer to the best suitable inner type; `jDataView.createBuffer` is left for backward compatibility.

Added `jDataView.prototype.slice` function for retrieving `jDataView` view on part of original one (supports options for pointing to the same memory buffer or copying data into new one).
`getBytes` now supports call w/o length argument (reads to the end of buffer by default).