Matt S Trout > Rakudo-Star-2012.08_001 > rakudo-star/parrot/runtime/parrot/library/Stream/Replay.pir

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

TITLE ^

Stream;Replay - replayable Stream

VERSION ^

version 0.1

SYNOPSIS ^

    load_bytecode 'Stream/Replay.pbc'

    $P0 = new ['Stream'; 'Replay']
    assign $P0, other_stream

    # .. read from $P0 ..

    $P1 = clone $P0

    # .. read further ..

    $P0 = $P1
    # now, if you read from $P0, you get the same data as after the clone

DESCRIPTION ^

By using clone, you can read data from a stream as often as you want.

METHODS ^

init

...

assign stream, source

...

stream."rawRead"() (internal)

...

stream2 = clone stream

...

AUTHOR ^

Jens Rieks <parrot at jensbeimsurfen dot de> is the author and maintainer. Please send patches and suggestions to the Perl 6 Internals mailing list.

COPYRIGHT ^

Copyright (C) 2004-2009, Parrot Foundation.

syntax highlighting: