TopLevel
Class DataView
DataView
The DataView provides low level access to ArrayBuffer.
API Versioned:
From version 21.2.
Properties
buffer
:
ArrayBuffer
The array buffer referenced by this view.
byteLength
:
Number
The number of bytes in the array buffer used by this view.
byteOffset
:
Number
The start offset for this view within the array buffer.
Constructor Summary
DataView(buffer
:
ArrayBuffer, byteOffset
:
Number, byteLength
:
Number)
Creates a data view on the given ArrayBuffer.
Method Summary
getFloat32(byteOffset
:
Number, littleEndian
:
boolean)
:
Number
Returns the 32-bit floating point number at the given offset.
getFloat64(byteOffset
:
Number, littleEndian
:
boolean)
:
Number
Returns the 64-bit floating point number at the given offset.
getInt16(byteOffset
:
Number, littleEndian
:
boolean)
:
Number
Returns the 16-bit signed integer number at the given offset.
getInt32(byteOffset
:
Number, littleEndian
:
boolean)
:
Number
Returns the 32-bit signed integer number at the given offset.
getUint16(byteOffset
:
Number, littleEndian
:
boolean)
:
Number
Returns the 16-bit unsigned integer number at the given offset.
getUint32(byteOffset
:
Number, littleEndian
:
boolean)
:
Number
Returns the 32-bit unsigned integer number at the given offset.
getUint8(byteOffset
:
Number)
:
Number
Returns the 8-bit unsigned integer number at the given offset.
setFloat32(byteOffset
:
Number, value
:
Number, littleEndian
:
boolean)
:
void
Writes a 32-bit floating point number into the byte array at the given offset.
setFloat64(byteOffset
:
Number, value
:
Number, littleEndian
:
boolean)
:
void
Writes a 64-bit floating point number into the byte array at the given offset.
setInt16(byteOffset
:
Number, value
:
Number, littleEndian
:
boolean)
:
void
Writes a 16-bit signed integer number into the byte array at the given offset.
setInt32(byteOffset
:
Number, value
:
Number, littleEndian
:
boolean)
:
void
Writes a 32-bit signed integer number into the byte array at the given offset.
setInt8(byteOffset
:
Number, value
:
Number)
:
void
Writes an 8-bit signed integer number into the byte array at the given offset.
setUint16(byteOffset
:
Number, value
:
Number, littleEndian
:
boolean)
:
void
Writes a 16-bit unsigned integer number into the byte array at the given offset.
Methods inherited from class
Object
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
Constructor Detail
DataView
Creates a data view on the given ArrayBuffer.
Parameters:
buffer
-
The array buffer storage object.
byteOffset
-
Optional. The offset within the array buffer in bytes.
byteLength
-
Optional. The number of bytes visible to this view.
Method Detail
getFloat32
Returns the 32-bit floating point number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
littleEndian
-
Optional. Default is false. Use true if the number is stored in little-endian format.
getFloat64
Returns the 64-bit floating point number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
littleEndian
-
Optional. Default is false. Use true if the number is stored in little-endian format.
getInt16
Returns the 16-bit signed integer number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
littleEndian
-
Optional. Default is false. Use true if the number is stored in little-endian format.
getInt32
Returns the 32-bit signed integer number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
littleEndian
-
Optional. Default is false. Use true if the number is stored in little-endian format.
getInt8
Returns the 8-bit signed integer number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
getUint16
Returns the 16-bit unsigned integer number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
littleEndian
-
Optional. Default is false. Use true if the number is stored in little-endian format.
getUint32
Returns the 32-bit unsigned integer number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
littleEndian
-
Optional. Default is false. Use true if the number is stored in little-endian format.
getUint8
Returns the 8-bit unsigned integer number at the given offset.
Parameters:
byteOffset
-
The offset within the view.
setFloat32
Writes a 32-bit floating point number into the byte array at the given offset.
Parameters:
byteOffset
-
The offset within the view.
value
-
The value to be written.
littleEndian
-
Optional. Default is false. Use true if the little-endian format is to be used.
setFloat64
Writes a 64-bit floating point number into the byte array at the given offset.
Parameters:
byteOffset
-
The offset within the view.
value
-
The value to be written.
littleEndian
-
Optional. Default is false. Use true if the little-endian format is to be used.
setInt16
Writes a 16-bit signed integer number into the byte array at the given offset.
Parameters:
byteOffset
-
The offset within the view.
value
-
The value to be written.
littleEndian
-
Optional. Default is false. Use true if the little-endian format is to be used.
setInt32
Writes a 32-bit signed integer number into the byte array at the given offset.
Parameters:
byteOffset
-
The offset within the view.
value
-
The value to be written.
littleEndian
-
Optional. Default is false. Use true if the little-endian format is to be used.
setInt8
Writes an 8-bit signed integer number into the byte array at the given offset.
Parameters:
byteOffset
-
The offset within the view.
value
-
The value to be written.
setUint16
Writes a 16-bit unsigned integer number into the byte array at the given offset.
Parameters:
byteOffset
-
The offset within the view.
value
-
The value to be written.
littleEndian
-
Optional. Default is false. Use true if the little-endian format is to be used.
© Copyright 2000-2024, salesforce.com inc. All rights reserved. Various trademarks held by their respective owners.