public interface Uint8Array extends ArrayBufferView, IndexableInt
The UInt8Array type represents an array of 8-bit unsigned integers.
Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
| Modifier and Type | Field and Description |
|---|---|
static int |
BYTES_PER_ELEMENT
The size, in bytes, of each array element.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLength()
The number of entries in the array; for these 8-bit values, this is the same as the size of the array in bytes.
|
void |
setElements(Object array) |
void |
setElements(Object array,
int offset) |
Uint8Array |
subarray(int start)
|
Uint8Array |
subarray(int start,
int end)
|
getBuffer, getByteLength, getByteOffsetintAt, lengthnumberAtstatic final int BYTES_PER_ELEMENT
int getLength()
void setElements(Object array)
void setElements(Object array, int offset)
Uint8Array subarray(int start)
Returns a new Uint8Array view on the ArrayBuffer store for this Uint8Array object.
beginUint8Array object.end
Optional
Uint8Array object; if not specified, all elements from the one specified by begin to the end of the array are included in the new view.The range specified by begin and end is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either begin or end is negative, it refers to an index from the end of the array instead of from the beginning.
Uint8Array subarray(int start, int end)
Returns a new Uint8Array view on the ArrayBuffer store for this Uint8Array object.
beginUint8Array object.end
Optional
Uint8Array object; if not specified, all elements from the one specified by begin to the end of the array are included in the new view.The range specified by begin and end is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either begin or end is negative, it refers to an index from the end of the array instead of from the beginning.
Copyright © 2016. All rights reserved.