slice


Purpose

Returns a new ArrayBuffer object instance.

Signature

ArrayBuffer.slice(begin, end)

Returns

Returns a new ArrayBuffer object instance. It contains a copy of this ArrayBuffer bytes from 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. If end is unspecified, then the new ArrayBuffer contains all bytes from begin to the end of this ArrayBuffer. 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 ArrayBuffer would be negative, then it is clamped to zero.

Parameter

Name Description Type Use
begin Specifies a value for the start point of a slice call, and must be treated as a byte-order position, with the zeroth position representing the first byte. int required
end Specifies a value for the end point of a slice call. int optional

Related topics

FileWriter
Overview
Legal notice | Copyright © 2015 and Confidential to Pegasystems Inc. All rights reserved. | Feedback
Advanced...