Next Previous Up Top Contents Index

5.11 The STREAMS module

read-into!

Open generic function

Summary

Reads a number of elements from a stream into a sequence.

Signature

read-into! input-stream n sequence #key start on-end-of-stream => count-or-eof 

Arguments

input-stream
An instance of <stream>.

n
An instance of <integer>.

sequence
An instance of <mutable-sequence>.

start
An instance of <integer>.

on-end-of-stream
An instance of <object>.

Values

count-or-eof
An instance of <integer>, or an instance of <object> if the end of stream is reached..

Library

io

Module

streams

Description

Reads the next n elements from input-stream, and inserts them into a mutable sequence starting at the position start. Returns the number of elements actually inserted into sequence unless the end of the stream is reached, in which case the on-end-of-stream behavior is as for read.

If the sum of start and n is greater than the size of sequence, read-into! reads only enough elements to fill sequence up to the end. If sequence is a stretchy vector, no attempt is made to grow it.

If the stream is not at its end, read-into! waits until input becomes available.

See also

read, page 44


System and I/O Reference - 31 MAR 2000

Next Previous Up Top Contents Index