< h1 id = "bufferobjects" > Buffer objects< / h1 >
< h2 > Overview of buffer types< / h2 >
< p > Duktape provides the following buffer and buffer-related types:< / p >
< table >
< tr >
< th > Type< / th >
< th > Standard< / th >
< th > Duktape version< / th >
< th > Description< / th >
< / tr >
< tr >
< td > Plain buffer< / td >
< td > No< br / > Duktape specific< / td >
< td > 1.0< / td >
< td > Plain, primitive buffer value (not an object), similar to how a plain string relates to a String object< / td >
< / tr >
< tr >
< td > Duktape.Buffer object< / td >
< td > No< br / > Duktape specific< / td >
< td > 1.0< / td >
< td > Object wrapped plain buffer, similar to how a String object relates to a plain string< / td >
< / tr >
< tr >
< td > Node.js Buffer object< / td >
< td > No< br / > Node.js-like< / td >
< td > 1.3< / td >
< td > Object with < a href = "https://nodejs.org/api/buffer.html" > Node.js Buffer API< / a > < / td >
< / tr >
< tr >
< td > ArrayBuffer object< / td >
< td > Yes< br / > Khronos/ES6< / td >
< td > 1.3< / td >
< td > Standard object type for representing a byte array< / td >
< / tr >
< tr >
< td > DataView, typed array objects< / td >
< td > Yes< br / > Khronos/ES6< / td >
< td > 1.3< / td >
< td > View objects to access an underlying ArrayBuffer< / td >
< / tr >
< / table >
< p > See < a href = "https://github.com/svaarala/duktape/blob/master/doc/buffers.rst" > buffers.rst< / a >
for a detailed discussion, including a
< a href = "https://github.com/svaarala/duktape/blob/master/doc/buffers.rst#summary-of-buffer-related-values" > detailed table of buffer types and their properties< / a > .< / p >
< h2 > Working with buffers< / h2 >
< p > Buffer values work in both C and Ecmascript code:< / p >
< ul >
< li > For Ecmascript code most of the behavior is defined in the relevant API
standards, with exceptions for Duktape-specific features like mixing
different buffer types.< / li >
< li > For C code there are API calls to work with
< a href = "api.html#taglist-buffer" > plain buffers< / a > and
< a href = "api.html#taglist-bufferobject" > buffer objects< / a > .< / li >
< / ul >
< p > See
< a href = "http://wiki.duktape.org/HowtoBuffers.html" > How to work with buffers< / a >
for examples.< / p >
< h2 > Current limitations< / h2 >
< ul >
< li > See < a href = "#typedarray-custombehavior" > TypedArray binding< / a > custom
behavior.< / li >
< li > See < a href = "#nodejsbuffer-custombehavior" > Node.js Buffer binding< / a > custom
behavior.< / li >
< / ul >