This built-in clause writes a byte to the current output stream, the stream is altered. The current output stream must be a binary stream that was opened for writing.
see also: get_byte/1 get_byte/2 peek_byte/1 peek_byte/2 prolog I/O put_byte/2
| Example | |
| put_byte(114). | Assume the current output stream has contents: 120, 66, 67 Succeeds with empty substitution and the stream is left as: 120, 66, 67, 114 |
| Exceptions | |
| byte is a variable | an instantiation_error is thrown |
| byte is neither a variable nor a byte | a type_error(byte, Byte) is thrown |
| current output stream is a text stream | a permission_error(output, text_stream, OutputStream) is thrown, the variable OutputStream is assigned the stream which was used as the output stream |