public final class Int8Array extends TypeArray
Modifier and Type | Field and Description |
---|---|
static int |
BYTES_PER_ELEMENT |
Modifier and Type | Method and Description |
---|---|
static Int8Array |
create(ArrayBuffer buffer)
Create a new Int8Array object using the passed
ArrayBuffer for
its storage. |
static Int8Array |
create(ArrayBuffer buffer,
int byteOffset)
Create a new Int8Array object using the passed
ArrayBuffer for
its storage. |
static Int8Array |
create(ArrayBuffer buffer,
int byteOffset,
int length)
Create a new Int8Array object using the passed
ArrayBuffer for
its storage. |
static Int8Array |
create(int... array)
Create a new
ArrayBuffer with enough bytes to hold array.length
elements of this typed array, then creates a typed array view referring
to the full buffer. |
static Int8Array |
create(int length)
Create a new
ArrayBuffer with enough bytes to hold length elements
of this typed array, then creates a typed array view referring to the full
buffer. |
static Int8Array |
create(com.google.gwt.core.client.JsArrayInteger array)
Create a new
ArrayBuffer with enough bytes to hold array.length
elements of this typed array, then creates a typed array view referring
to the full buffer. |
static Int8Array |
create(TypeArray array)
Create a new
ArrayBuffer with enough bytes to hold array.length
elements of this typed array, then creates a typed array view referring
to the full buffer. |
int |
get(int index)
Returns the element at the given numeric index.
|
void |
set(int index,
int value)
Sets the element at the given numeric index to the given value.
|
void |
set(com.google.gwt.core.client.JsArrayInteger array)
Set multiple values, reading input values from the array.
|
void |
set(com.google.gwt.core.client.JsArrayInteger array,
int offset)
/**
Set multiple values, reading input values from the array.
|
Int8Array |
slice(int begin)
Returns a new Int8Array view of the
ArrayBuffer store for this
Int8Array, referencing the elements at begin, inclusive, up to end,
exclusive. |
Int8Array |
slice(int begin,
int end)
Returns a new Int8Array view of the
ArrayBuffer store for this
Int8Array, referencing the elements at begin, inclusive, up to end,
exclusive. |
getLength, reverse, set, set
getBuffer, getByteLength, getByteOffset
public static final int BYTES_PER_ELEMENT
public static Int8Array create(int length)
ArrayBuffer
with enough bytes to hold length elements
of this typed array, then creates a typed array view referring to the full
buffer.length
- public static Int8Array create(TypeArray array)
ArrayBuffer
with enough bytes to hold array.length
elements of this typed array, then creates a typed array view referring
to the full buffer. The contents of the new view are initialized to the
contents of the given typed array or sequence, with each element converted
to the appropriate typed array type.array
- public static Int8Array create(int... array)
ArrayBuffer
with enough bytes to hold array.length
elements of this typed array, then creates a typed array view referring
to the full buffer. The contents of the new view are initialized to the
contents of the given typed array or sequence, with each element converted
to the appropriate typed array type.array
- public static Int8Array create(com.google.gwt.core.client.JsArrayInteger array)
ArrayBuffer
with enough bytes to hold array.length
elements of this typed array, then creates a typed array view referring
to the full buffer. The contents of the new view are initialized to the
contents of the given typed array or sequence, with each element converted
to the appropriate typed array type.array
- public static Int8Array create(ArrayBuffer buffer)
ArrayBuffer
for
its storage. The Int8Array spans the entire ArrayBuffer
range.buffer
- public static Int8Array create(ArrayBuffer buffer, int byteOffset)
ArrayBuffer
for
its storage. The Int8Array extends from the given byteOffset until the
end of the ArrayBuffer
.
The given byteOffset must be a multiple of the element size of the
specific type, otherwise an INDEX_SIZE_ERR exception is raised.
If a given byteOffset references an area beyond the end of the
ArrayBuffer
an INDEX_SIZE_ERR exception is raised.
The length of the ArrayBuffer
minus the byteOffset must be a
multiple of the element size of the specific type, or an INDEX_SIZE_ERR
exception is raised.buffer
- byteOffset
- indicates the offset in bytes from the start of the
ArrayBuffer
public static Int8Array create(ArrayBuffer buffer, int byteOffset, int length)
ArrayBuffer
for
its storage.
The given byteOffset must be a multiple of the element size of the
specific type, otherwise an INDEX_SIZE_ERR exception is raised.
If a given byteOffset and length references an area beyond the end of the
ArrayBuffer
an INDEX_SIZE_ERR exception is raised.buffer
- byteOffset
- indicates the offset in bytes from the start of the
ArrayBuffer
length
- the count of elements from the offset that this
Int8Array will referencepublic int get(int index)
index
- public void set(int index, int value)
index
- value
- public void set(com.google.gwt.core.client.JsArrayInteger array)
public void set(com.google.gwt.core.client.JsArrayInteger array, int offset)
array
- offset
- indicates the index in the current array where values are
written.public Int8Array slice(int begin)
ArrayBuffer
store for this
Int8Array, referencing the elements at begin, inclusive, up to end,
exclusive. If either begin or end is negative, it refers to an index from
the end of the array, as opposed to from the beginning.
The slice contains all elements from begin to the end of the Int8Array.
The range specified by the begin and end values is clamped to the valid
index range for the current array. If the computed length of the new
Int8Array would be negative, it is clamped to zero.
The returned Int8Array will be of the same type as the array on which this
method is invoked.begin
- public Int8Array slice(int begin, int end)
ArrayBuffer
store for this
Int8Array, referencing the elements at begin, inclusive, up to end,
exclusive. If either begin or end is negative, it refers to an index from
the end of the array, as opposed to from the beginning.
The slice contains all elements from begin to the end of the Int8Array.
The range specified by the begin and end values is clamped to the valid
index range for the current array. If the computed length of the new
Int8Array would be negative, it is clamped to zero.
The returned Int8Array will be of the same type as the array on which this
method is invoked.begin
- end
-