summaryrefslogtreecommitdiff
path: root/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala
diff options
context:
space:
mode:
authorHaoyi Li <haoyi@haoyi-mbp.corp.dropbox.com>2014-11-26 00:45:31 -0800
committerHaoyi Li <haoyi@haoyi-mbp.corp.dropbox.com>2014-11-26 00:45:31 -0800
commit24f31e120f9537faede7a174bb09ee35f64e1ce4 (patch)
tree06ffc3ecc7847789008352b7e2b7c040dad48907 /examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala
parentb89ce9cbf79363f8cab09186a5d7ba94bc0af02a (diff)
parent2c4b142503bd2d871e6818b5cab8c38627d9e4a0 (diff)
downloadhands-on-scala-js-24f31e120f9537faede7a174bb09ee35f64e1ce4.tar.gz
hands-on-scala-js-24f31e120f9537faede7a174bb09ee35f64e1ce4.tar.bz2
hands-on-scala-js-24f31e120f9537faede7a174bb09ee35f64e1ce4.zip
Merge commit '2c4b142503bd2d871e6818b5cab8c38627d9e4a0' as 'examples/scala-js'
Diffstat (limited to 'examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala')
-rw-r--r--examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala
new file mode 100644
index 0000000..690ff07
--- /dev/null
+++ b/examples/scala-js/library/src/main/scala/scala/scalajs/js/typedarray/Int8Array.scala
@@ -0,0 +1,24 @@
+package scala.scalajs.js.typedarray
+
+import scala.scalajs.js
+
+class Int8Array private extends TypedArray[Byte, Int8Array] {
+
+ /** Constructs a Int8Array with the given length. Initialized to all 0 */
+ def this(length: Int) = this()
+
+ /** Creates a new Int8Array with the same elements than the given TypedArray
+ *
+ * The elements are converted before being stored in the new Int8Array.
+ */
+ def this(typedArray: TypedArray[_, _]) = this()
+
+ /** Creates a new Int8Array with the elements in the given array */
+ def this(array: js.Array[_]) = this()
+
+ /** Creates a Int8Array view on the given ArrayBuffer */
+ def this(buffer: ArrayBuffer, byteOffset: Int = 0, length: Int = ???) = this()
+
+}
+
+object Int8Array extends TypedArrayStatic