NewArrayBuffer returns a ArrayBuffer value with given binary data.
(binaryData []byte)
| 467 | |
| 468 | // NewArrayBuffer returns a ArrayBuffer value with given binary data. |
| 469 | func (ctx *Context) NewArrayBuffer(binaryData []byte) *Value { |
| 470 | if len(binaryData) == 0 { |
| 471 | return &Value{ctx: ctx, ref: C.JS_NewArrayBufferCopy(ctx.ref, nil, 0)} |
| 472 | } |
| 473 | return &Value{ctx: ctx, ref: C.JS_NewArrayBufferCopy(ctx.ref, (*C.uchar)(&binaryData[0]), C.size_t(len(binaryData)))} |
| 474 | } |
| 475 | |
| 476 | // ArrayBuffer returns a ArrayBuffer value with given binary data. |
| 477 | // Deprecated: Use NewArrayBuffer() instead. |
no outgoing calls