|Did you know ...
|Pack canny_tudor -- prolog/swi/memfilesio.pl
Both terms apply herein. Variable names reflect the subtle but essential distinction. All octets are bytes but not all bytes are octets. Byte is merely eight bits, nothing more implied, whereas octet implies important inter-byte ordering according to some big- or little-endian convention.
current_output collected in MemoryFile according to the encoding
within Options. Defaults to UTF-8 encoding.
A good reason exists for putting bytes rather than writing codes. The put_byte/1 predicate throws with permission error when writing to a text stream. Bytes are not Unicode text; they have an entirely different ontology.