FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
This page is new in 9.0.

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-2015, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 9.0. This page is new in the 9.0 release.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
This page is new in 9.0.