A java.io.InputStream wrapping a JavaScript ArrayBuffer
A java.io.InputStream wrapping a JavaScript ArrayBuffer
This class is extremely similar to a ByteArrayInputStream, but uses ArrayBuffers as the underlying representation. Stream implementations may special case on this stream for better performance and access the underlying buffer directly. (They still need to make sure the internal pointers are properly aligned though).
This stream has several public members (n.b. buffer, offset, length and pos) in order to allow JavaScript aware applications to special case on this kind of stream and access the underlying ArrayBuffer directly for efficiency. In this case it is the client's responsibility to synchronize pos, as if the stream were read normally (if the context in which it is used requires this).
The typdearray package provides facade types for JavaScript ArrayBuffer, TypeArrays and DataView. Further, it provides conversions between primitive Scala arrays and TypedArrays