public abstract class ArrayBufferViewImpl extends Object implements ArrayBufferView
ArrayBufferView
implementations.Modifier and Type | Field and Description |
---|---|
protected ArrayBufferImpl |
arrayBuf |
protected int |
byteLength |
protected int |
byteOffset |
Constructor and Description |
---|
ArrayBufferViewImpl(ArrayBuffer buffer,
int byteOffset,
int byteLength) |
Modifier and Type | Method and Description |
---|---|
ArrayBuffer |
buffer()
Get the underlying
ArrayBuffer . |
int |
byteLength()
Get the length of this view in bytes.
|
int |
byteOffset()
Get the offset from the beginning of the underlying
ArrayBuffer . |
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.
|
protected final ArrayBufferImpl arrayBuf
protected final int byteLength
protected final int byteOffset
public ArrayBufferViewImpl(ArrayBuffer buffer, int byteOffset, int byteLength)
buffer
- byteOffset
- byteLength
- public ArrayBuffer buffer()
ArrayBufferView
ArrayBuffer
.buffer
in interface ArrayBufferView
ArrayBuffer
instance backing this viewpublic int byteLength()
ArrayBufferView
byteLength
in interface ArrayBufferView
public int byteOffset()
ArrayBufferView
ArrayBuffer
.byteOffset
in interface ArrayBufferView
ArrayBufferView.buffer()
protected int checkRange(int index, int bytesPerElement)
index
- an element indexbytesPerElement
- Copyright © 2016. All rights reserved.