FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

peek-byte

Arguments: stream &optional (eof-error-p t)eof-value

This one-byte analog of peek-char is similar to read-byte, but if the result of the read does not cause an eof condition the octet is put back again. If it returns, peek-byte returns either the next octet to be read or the eof-value if at eof. Note that peek-byte is not as complex as peek-char, since there is no concept of whitespace characters when characters are not involved.

As with peek-char, if an eof is read, an error is signaled if eof-error-p is true, otherwise eof-value is returned.

peek-byte is essentially equivalent to a read-byte followed by a possible unread-byte. Unlike unread-byte, peek-byte is guaranteed to work under all normal circumstances (including at eof).

peek-byte currently does not work in Gray streams - error is called when peek-byte is called on a Gray stream. (Gray streams are discussed in gray-streams.htm.)

See peek-byte and unread-byte in streams.htm for a general discussion of this function and the related unread-byte.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version