Class ArrayBufferViewImpl
java.lang.Object
com.google.gwt.typedarrays.server.ArrayBufferViewImpl
- All Implemented Interfaces:
ArrayBufferView
- Direct Known Subclasses:
DataViewImpl,Float32ArrayImpl,Float64ArrayImpl,Int16ArrayImpl,Int32ArrayImpl,Int8ArrayImpl,Uint16ArrayImpl,Uint32ArrayImpl,Uint8ArrayImpl
Base class for
ArrayBufferView implementations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ArrayBufferImplprotected final intprotected final int(package private) static final booleanThe spec lets the platform's native endianness come through, so we choose to expose little-endian regardless -- if apps care about the endianness but don't test for it, it is likely they assume little-endian. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuffer()Get the underlyingArrayBuffer.intGet the length of this view in bytes.intGet the offset from the beginning of the underlyingArrayBuffer.protected intcheckRange(int index, int bytesPerElement) Check the index range and throw an exception if out of range, if ok return the byte index of the specified element.
-
Field Details
-
USE_LITTLE_ENDIAN
static final boolean USE_LITTLE_ENDIANThe spec lets the platform's native endianness come through, so we choose to expose little-endian regardless -- if apps care about the endianness but don't test for it, it is likely they assume little-endian.- See Also:
-
arrayBuf
-
byteLength
protected final int byteLength -
byteOffset
protected final int byteOffset
-
-
Constructor Details
-
Method Details
-
buffer
Description copied from interface:ArrayBufferViewGet the underlyingArrayBuffer.- Specified by:
bufferin interfaceArrayBufferView- Returns:
- the
ArrayBufferinstance backing this view
-
byteLength
public int byteLength()Description copied from interface:ArrayBufferViewGet the length of this view in bytes.- Specified by:
byteLengthin interfaceArrayBufferView- Returns:
- number of bytes in this view
-
byteOffset
public int byteOffset()Description copied from interface:ArrayBufferViewGet the offset from the beginning of the underlyingArrayBuffer.- Specified by:
byteOffsetin interfaceArrayBufferView- Returns:
- 0-based offset from the beginning of
ArrayBufferView.buffer()
-
checkRange
protected int checkRange(int index, int bytesPerElement) Check the index range and throw an exception if out of range, if ok return the byte index of the specified element.- Parameters:
index- an element indexbytesPerElement-- Returns:
- the byte index of the start of this element
-