Skip to main content

blob.seek(offset, offsetBasis)

Sets the location of the blob’s read/write pointer

Availability

Device + Agent

Parameters

Name Type Description
offset Integer The offset from the current location
offsetBasis Constant Optional single-character string constant to specify a point from which to apply the offset

Returns

Integer — 0 or -1 (see description)

Description

This method moves the location of the blob’s read/write pointer. By default, it is provided as a positive offset from the start of the blob, but an optional origin point can be passed to the method using the second parameter. This option is a string constant which must be delimited by single quote marks:

String Constant Location
'e' End of the blob
'c' Current position of the pointer
'b' Beginning of the blob

Attempts to set pointer beyond the start or the end of the blob will leave the pointer where it is. If this happens, the method returns the value -1; otherwise, 0 is returned.

The current location of the pointer can be determined using the tell() method.

Example Code