11.3.152 peek_byte/[1,2]   ISO

Synopsis

peek_byte(-Byte)

peek_byte(+Stream, -Byte)

looks ahead for next input byte on the input stream Stream.

Arguments

Stream

stream_object, must be ground

A valid input binary stream, defaults to the current input stream.

Byte

byte or -1

The resulting next input byte available on the stream.

Description

peek_byte/[1,2] looks ahead of the next input byte of the specified input stream and unifies the byte with Byte. The peeked byte is still available for subsequent input on the stream.

Exceptions

Stream errors (see ref-iou-sfh-est), plus:

type_error

Byte is an invalid byte.

permission_error

Trying to read beyond end of Stream

See Also

ref-iou-cin.


Send feedback on this subject.