|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.typedarrays.shared.TypedArrays
public class TypedArrays
Factory class for various typed arrays. Behavior of all other methods is
undefined if isSupported()
returns false.
In client code, the various types are implemented by JavaScriptObjects, so you cannot reliable use instanceof checks on any of the returned implementations.
Nested Class Summary | |
---|---|
static class |
TypedArrays.Impl
Base class of implementations for creating various typed array structures. |
Constructor Summary | |
---|---|
TypedArrays()
|
Method Summary | |
---|---|
static ArrayBuffer |
createArrayBuffer(int length)
Create a new ArrayBuffer of length bytes. |
static DataView |
createDataView(ArrayBuffer buffer)
Create a new DataView instance on an ArrayBuffer . |
static DataView |
createDataView(ArrayBuffer buffer,
int byteOffset)
Create a new DataView instance on an ArrayBuffer , starting
at an offset of byteOffset . |
static DataView |
createDataView(ArrayBuffer buffer,
int byteOffset,
int byteLength)
Create a new DataView instance on an ArrayBuffer , starting
at an offset of byteOffset and continuing for length
bytes. |
static Float32Array |
createFloat32Array(ArrayBuffer buffer)
Create a Float32Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements). |
static Float32Array |
createFloat32Array(ArrayBuffer buffer,
int byteOffset)
Create a Float32Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer
(which must be an integral number of elements). |
static Float32Array |
createFloat32Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Float32Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Float32Array |
createFloat32Array(int length)
Create a Float32Array instance of length elements, backed
by a new ArrayBuffer . |
static Float64Array |
createFloat64Array(ArrayBuffer buffer)
Create a Float64Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements). |
static Float64Array |
createFloat64Array(ArrayBuffer buffer,
int byteOffset)
Create a Float64Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer
(which must be an integral number of elements). |
static Float64Array |
createFloat64Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Float64Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Float64Array |
createFloat64Array(int length)
Create a Float64Array instance of length elements, backed
by a new ArrayBuffer . |
static Int16Array |
createInt16Array(ArrayBuffer buffer)
Create a Int16Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements). |
static Int16Array |
createInt16Array(ArrayBuffer buffer,
int byteOffset)
Create a Int16Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer
(which must be an integral number of elements). |
static Int16Array |
createInt16Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Int16Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Int16Array |
createInt16Array(int length)
Create a Int16Array instance of length elements, backed
by a new ArrayBuffer . |
static Int32Array |
createInt32Array(ArrayBuffer buffer)
Create a Int32Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements). |
static Int32Array |
createInt32Array(ArrayBuffer buffer,
int byteOffset)
Create a Int32Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer
(which must be an integral number of elements). |
static Int32Array |
createInt32Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Int32Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Int32Array |
createInt32Array(int length)
Create a Int32Array instance of length elements, backed
by a new ArrayBuffer . |
static Int8Array |
createInt8Array(ArrayBuffer buffer)
Create a Int8Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end. |
static Int8Array |
createInt8Array(ArrayBuffer buffer,
int byteOffset)
Create a Int8Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer
(which must be an integral number of elements). |
static Int8Array |
createInt8Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Int8Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Int8Array |
createInt8Array(int length)
Create a Int8Array instance of length elements, backed
by a new ArrayBuffer . |
static Uint16Array |
createUint16Array(ArrayBuffer buffer)
Create a Uint16Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements). |
static Uint16Array |
createUint16Array(ArrayBuffer buffer,
int byteOffset)
Create a Uint16Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer
(which must be an integral number of elements). |
static Uint16Array |
createUint16Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Uint16Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Uint16Array |
createUint16Array(int length)
Create a Uint16Array instance of length elements, backed
by a new ArrayBuffer . |
static Uint32Array |
createUint32Array(ArrayBuffer buffer)
Create a Uint32Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements). |
static Uint32Array |
createUint32Array(ArrayBuffer buffer,
int byteOffset)
Create a Uint32Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer
(which must be an integral number of elements). |
static Uint32Array |
createUint32Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Uint32Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Uint32Array |
createUint32Array(int length)
Create a Uint32Array instance of length elements, backed
by a new ArrayBuffer . |
static Uint8Array |
createUint8Array(ArrayBuffer buffer)
Create a Uint8Array instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements). |
static Uint8Array |
createUint8Array(ArrayBuffer buffer,
int byteOffset)
Create a Uint8Array instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer. |
static Uint8Array |
createUint8Array(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Uint8Array instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Uint8Array |
createUint8Array(int length)
Create a Uint8Array instance of length elements, backed
by a new ArrayBuffer . |
static Uint8ClampedArray |
createUint8ClampedArray(ArrayBuffer buffer)
Create a Uint8ClampedArray instance on buffer , starting at
starting at the beginning of the buffer and continuing to the end. |
static Uint8ClampedArray |
createUint8ClampedArray(ArrayBuffer buffer,
int byteOffset)
Create a Uint8ClampedArray instance on buffer , starting at
byteOffset into the buffer, continuing to the end of the buffer. |
static Uint8ClampedArray |
createUint8ClampedArray(ArrayBuffer buffer,
int byteOffset,
int length)
Create a Uint8ClampedArray instance on buffer , starting at
byteOffset into the buffer, continuing for length
elements. |
static Uint8ClampedArray |
createUint8ClampedArray(int length)
Create a Uint8ClampedArray instance of length elements, backed
by a new ArrayBuffer . |
static boolean |
isSupported()
Check if the current environment supports typed arrays. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypedArrays()
Method Detail |
---|
public static ArrayBuffer createArrayBuffer(int length)
ArrayBuffer
of length
bytes.
length
- length of buffer in bytes
ArrayBuffer
instancepublic static DataView createDataView(ArrayBuffer buffer)
DataView
instance on an ArrayBuffer
.
buffer
- ArrayBuffer
DataView
instancepublic static DataView createDataView(ArrayBuffer buffer, int byteOffset)
DataView
instance on an ArrayBuffer
, starting
at an offset of byteOffset
.
buffer
- ArrayBuffer
byteOffset
- offset into buffer
DataView
instancepublic static DataView createDataView(ArrayBuffer buffer, int byteOffset, int byteLength)
DataView
instance on an ArrayBuffer
, starting
at an offset of byteOffset
and continuing for length
bytes.
buffer
- ArrayBuffer
byteOffset
- offset into bufferbyteLength
- length of view in bytes
DataView
instancepublic static Float32Array createFloat32Array(ArrayBuffer buffer)
Float32Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements).
buffer
- underlying ArrayBuffer
Float32Array
instancepublic static Float32Array createFloat32Array(ArrayBuffer buffer, int byteOffset)
Float32Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer
(which must be an integral number of elements).
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Float32Array
instancepublic static Float32Array createFloat32Array(ArrayBuffer buffer, int byteOffset, int length)
Float32Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Float32Array
instancepublic static Float32Array createFloat32Array(int length)
Float32Array
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Float32Array
instancepublic static Float64Array createFloat64Array(ArrayBuffer buffer)
Float64Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements).
Note that Safari does not currently support Float64 Arrays!
buffer
- underlying ArrayBuffer
Float64Array
instancepublic static Float64Array createFloat64Array(ArrayBuffer buffer, int byteOffset)
Float64Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer
(which must be an integral number of elements).
Note that Safari does not currently support Float64 Arrays!
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Float64Array
instancepublic static Float64Array createFloat64Array(ArrayBuffer buffer, int byteOffset, int length)
Float64Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
Note that Safari does not currently support Float64 Arrays!
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Float64Array
instancepublic static Float64Array createFloat64Array(int length)
Float64Array
instance of length
elements, backed
by a new ArrayBuffer
.
Note that Safari does not currently support Float64 Arrays!
length
- size of array
Float64Array
instancepublic static Int16Array createInt16Array(ArrayBuffer buffer)
Int16Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements).
buffer
- underlying ArrayBuffer
Int16Array
instancepublic static Int16Array createInt16Array(ArrayBuffer buffer, int byteOffset)
Int16Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer
(which must be an integral number of elements).
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Int16Array
instancepublic static Int16Array createInt16Array(ArrayBuffer buffer, int byteOffset, int length)
Int16Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Int16Array
instancepublic static Int16Array createInt16Array(int length)
Int16Array
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Int16Array
instancepublic static Int32Array createInt32Array(ArrayBuffer buffer)
Int32Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements).
buffer
- underlying ArrayBuffer
Int32Array
instancepublic static Int32Array createInt32Array(ArrayBuffer buffer, int byteOffset)
Int32Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer
(which must be an integral number of elements).
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Int32Array
instancepublic static Int32Array createInt32Array(ArrayBuffer buffer, int byteOffset, int length)
Int32Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Int32Array
instancepublic static Int32Array createInt32Array(int length)
Int32Array
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Int32Array
instancepublic static Int8Array createInt8Array(ArrayBuffer buffer)
Int8Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end.
buffer
- underlying ArrayBuffer
Int8Array
instancepublic static Int8Array createInt8Array(ArrayBuffer buffer, int byteOffset)
Int8Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer
(which must be an integral number of elements).
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Int8Array
instancepublic static Int8Array createInt8Array(ArrayBuffer buffer, int byteOffset, int length)
Int8Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Int8Array
instancepublic static Int8Array createInt8Array(int length)
Int8Array
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Int8Array
instancepublic static Uint16Array createUint16Array(ArrayBuffer buffer)
Uint16Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements).
buffer
- underlying ArrayBuffer
Uint16Array
instancepublic static Uint16Array createUint16Array(ArrayBuffer buffer, int byteOffset)
Uint16Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer
(which must be an integral number of elements).
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Uint16Array
instancepublic static Uint16Array createUint16Array(ArrayBuffer buffer, int byteOffset, int length)
Uint16Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Uint16Array
instancepublic static Uint16Array createUint16Array(int length)
Uint16Array
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Uint16Array
instancepublic static Uint32Array createUint32Array(ArrayBuffer buffer)
Uint32Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements).
buffer
- underlying ArrayBuffer
Uint32Array
instancepublic static Uint32Array createUint32Array(ArrayBuffer buffer, int byteOffset)
Uint32Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer
(which must be an integral number of elements).
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Uint32Array
instancepublic static Uint32Array createUint32Array(ArrayBuffer buffer, int byteOffset, int length)
Uint32Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Uint32Array
instancepublic static Uint32Array createUint32Array(int length)
Uint32Array
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Uint32Array
instancepublic static Uint8Array createUint8Array(ArrayBuffer buffer)
Uint8Array
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end (which
must be an integral number of elements).
buffer
- underlying ArrayBuffer
Uint8Array
instancepublic static Uint8Array createUint8Array(ArrayBuffer buffer, int byteOffset)
Uint8Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Uint8Array
instancepublic static Uint8Array createUint8Array(ArrayBuffer buffer, int byteOffset, int length)
Uint8Array
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Uint8Array
instancepublic static Uint8Array createUint8Array(int length)
Uint8Array
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Uint8Array
instancepublic static Uint8ClampedArray createUint8ClampedArray(ArrayBuffer buffer)
Uint8ClampedArray
instance on buffer
, starting at
starting at the beginning of the buffer and continuing to the end.
buffer
- underlying ArrayBuffer
Uint8ClampedArray
instancepublic static Uint8ClampedArray createUint8ClampedArray(ArrayBuffer buffer, int byteOffset)
Uint8ClampedArray
instance on buffer
, starting at
byteOffset
into the buffer, continuing to the end of the buffer.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
Uint8ClampedArray
instancepublic static Uint8ClampedArray createUint8ClampedArray(ArrayBuffer buffer, int byteOffset, int length)
Uint8ClampedArray
instance on buffer
, starting at
byteOffset
into the buffer, continuing for length
elements.
buffer
- underlying ArrayBuffer
byteOffset
- byte offset from the start of buffer
length
- number of elements in the resulting array
Uint8ClampedArray
instancepublic static Uint8ClampedArray createUint8ClampedArray(int length)
Uint8ClampedArray
instance of length
elements, backed
by a new ArrayBuffer
.
length
- size of array
Uint8ClampedArray
instancepublic static boolean isSupported()
createXXX
methods is undefined if this method returns
false
, but will typically throw some exception.
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |