write-byte
write-byte byte stream β byte
byteβan integer of the stream element type of stream.
streamβa binary output stream.
22.3.2 4write-byte writes one byte, byte, to stream.
The size of the byte written depends on the {\bf :element-type} argument from \funref{open} or \macref{with-open-file}. Unless the byte size of that element type is one, two, or four bits, each call to \funref{write-byte} generates an integral number of 8-bit bytes, namely the minimum number necessary to hold the number of bits indicated by the given element type. If the byte size of the element type is one, two, or four bits, then as many elements as possible (eight, four, or two respectively) are packed into each 8-bit byte.
(with-open-file (s "temp-bytes"
:direction :output
:element-type 'unsigned-byte)
(write-byte 101 s)) β 101
stream is modified.
The element type of the stream.
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 output stream.
Might signal an error of type type-error if byte is not an integer of the stream element type of stream.
read-byte, write-char, write-sequence
None.