User Tools


Function READ-BYTE

Syntax

  • read-byte stream &optional eof-error-p eof-valuebyte

Arguments and Values

Description

read-byte reads and returns one byte from stream.

If an end of file occurs and eof-error-p is false, the eof-value is returned.

Examples

(with-open-file (s "temp-bytes" :direction :output :element-type 'unsigned-byte) (write-byte 101 s))

101

(with-open-file (s "temp-bytes" :element-type 'unsigned-byte) (format t "~S ~S" (read-byte s) (read-byte s nil 'eof)))

101 EOF

NIL

Side Effects

Modifies stream.

Affected By

None.

Exceptional Situations

Should signal an error of type type-error if stream is not a stream.

Should signal an error of type error if stream is not a binary input stream.

If there are no bytes remaining in the stream and eof-error-p is true, an error of type end-of-file is signaled.

See Also

Notes

None.

\issue{ARGUMENTS-UNDERSPECIFIED:SPECIFY} \issue{READ-AND-WRITE-BYTES:NEW-FUNCTIONS}