2 namespace WebAssembly
.Core
{
3 public class ArrayBuffer
: CoreObject
{
6 /// Initializes a new instance of the <see cref="T:WebAssembly.Core.ArrayBuffer"/> class.
8 public ArrayBuffer () : base (Runtime
.New
<ArrayBuffer
> ())
12 /// Initializes a new instance of the <see cref="T:WebAssembly.Core.ArrayBuffer"/> class.
14 /// <param name="length">Length.</param>
15 public ArrayBuffer (int length
) : base (Runtime
.New
<ArrayBuffer
> (length
))
19 /// Initializes a new instance of the <see cref="T:WebAssembly.Core.ArrayBuffer"/> class.
21 /// <param name="js_handle">Js handle.</param>
22 internal ArrayBuffer (IntPtr js_handle
) : base (js_handle
)
26 /// The length of an ArrayBuffer in bytes.
28 /// <value>The length of the byte.</value>
29 public int ByteLength
=> (int)GetObjectProperty ("byteLength");
31 /// Gets a value indicating whether this <see cref="T:WebAssembly.Core.ArrayBuffer"/> is view.
33 /// <value><c>true</c> if is view; otherwise, <c>false</c>.</value>
34 public bool IsView
=> (bool)GetObjectProperty ("isView");
36 /// Slice the specified begin.
38 /// <returns>The slice.</returns>
39 /// <param name="begin">Begin.</param>
40 public ArrayBuffer
Slice (int begin
) => (ArrayBuffer
)Invoke ("slice", begin
);
42 /// Slice the specified begin and end.
44 /// <returns>The slice.</returns>
45 /// <param name="begin">Begin.</param>
46 /// <param name="end">End.</param>
47 public ArrayBuffer
Slice (int begin
, int end
) => (ArrayBuffer
)Invoke ("slice", begin
, end
);