AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YDAT | YWAIT | Byzgraf | FAQs
readStream (Stream stream [, int count]) yoix.io
 
Efficiently reads the entire stream, or at most count characters, into a new string and returns that string or NULL if there is nothing to read or an error occurs. The entire stream is also read when count is a non-positive number, which works particularly well with the size field in a URL. The callback builtin available in all Streams provides an easy and efficient way to monitor the progress of readStream, which can be very important when large amounts of data are transferred over a network connection.
 
 Example:   The program,
import yoix.io.*;

URL att = open("http://www.att.com", "r", URL);

stdout.nextbuf = readStream(att);
reads the entire AT&T homepage into a string and then copies that string to standard output.
 
 Return:   String
 
 See Also:   read, readChar, readLine, ready

 

Yoix is a registered trademark of AT&T Intellectual Property.