PeekStream

Description:              This function returns a string of bytes from a stream without removing them from the stream.

Returns:                    See description

Usage:                       Script

Format:                      PeekStream(Stream, N)

Parameters:             Stream    { Stream }  { required }  { no default: }

                                      Any expression returning a pipe stream.

                                    N    { numeric }  { required }  { no default: }

                                      Any numeric expression giving the number of bytes to get from the pipe.

Comments:               Execution of this function doesn't affect the stream position pointer.

                             Second parameter must be 65,523 characters or less; otherwise invalid will be returned.

Example:

If ! Valid(data);

[

  data = PeekStream(strm, 10); 

]

This stores the last 10 bytes from strm in data. The stream is unaffected.

See Also:

GetStreamLength | PipeStream | SRead | StreamEnd