Documentation Prolog Predicate Reference builtin get_byte/1


Read byte from current input stream.


get_byte( -byte )

get_byte(Byte) reads the next byte from the current input stream and unifies it with Byte, being Byte a integer between 0 and 255.

Note: in JavaScript, characters are represented using 16 bits, so, in browser, getting the bytes of a single character will make this predicate unify twice: the first time for the 8 least significant bits, and the second one for the next 8 bits. In the case of Node.js, the bits used to represent a character will depend on the file encoding.