mark

Synopsis

mark([$handle], n)

marks the current point in this IO stream. a buffer is created allowing the mark to be &reset until n bytes has been reached.

Parameters

$handle - the handle to mark

n - the number of bytes to buffer (to allow for a reset back to this mark later) (default is a 10KB buffer)

Side Effects / Notes

Examples

$buffer = allocate(); writeb($buffer, "this.is.an.example"); closef($buffer); println("Read: " . readb($buffer, 4)); mark($buffer); println("Read: " . readb($buffer, 4)); reset($buffer); println("Read: " . readb($buffer, -1));

Read: this Read: .is. Read: .is.an.example

See Also