Update sdks/wasm/framework/src/WebAssembly.Bindings/Core/ArrayBuffer.cs
[mono-project.git] / sdks / wasm / framework / src / WebAssembly.Bindings / Core / ArrayBuffer.cs
blob063773ae58de9058cfdbb05f7cd50ffbc487c344
1 using System;
2 namespace WebAssembly.Core {
3 public class ArrayBuffer : CoreObject {
5 /// <summary>
6 /// Initializes a new instance of the <see cref="T:WebAssembly.Core.ArrayBuffer"/> class.
7 /// </summary>
8 public ArrayBuffer () : base (Runtime.New<ArrayBuffer> ())
9 { }
11 /// <summary>
12 /// Initializes a new instance of the <see cref="T:WebAssembly.Core.ArrayBuffer"/> class.
13 /// </summary>
14 /// <param name="length">Length.</param>
15 public ArrayBuffer (int length) : base (Runtime.New<ArrayBuffer> (length))
16 { }
18 /// <summary>
19 /// Initializes a new instance of the <see cref="T:WebAssembly.Core.ArrayBuffer"/> class.
20 /// </summary>
21 /// <param name="js_handle">Js handle.</param>
22 internal ArrayBuffer (IntPtr js_handle) : base (js_handle)
23 { }
25 /// <summary>
26 /// The length of an ArrayBuffer in bytes.
27 /// </summary>
28 /// <value>The length of the byte.</value>
29 public int ByteLength => (int)GetObjectProperty ("byteLength");
30 /// <summary>
31 /// Gets a value indicating whether this <see cref="T:WebAssembly.Core.ArrayBuffer"/> is view.
32 /// </summary>
33 /// <value><c>true</c> if is view; otherwise, <c>false</c>.</value>
34 public bool IsView => (bool)GetObjectProperty ("isView");
35 /// <summary>
36 /// Slice the specified begin.
37 /// </summary>
38 /// <returns>The slice.</returns>
39 /// <param name="begin">Begin.</param>
40 public ArrayBuffer Slice (int begin) => (ArrayBuffer)Invoke ("slice", begin);
41 /// <summary>
42 /// Slice the specified begin and end.
43 /// </summary>
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);