Bitstream
This article needs additional citations for verification. (December 2016) |
A bitstream (or bit stream), also known as binary sequence, is a sequence of bits. A bytestream is a sequence of bytes. Typically, each byte is an 8-bit quantity, and so the term octet stream is sometimes used interchangeably. An octet may be encoded as a sequence of 8 bits in multiple different ways (see bit numbering) so there is no unique and direct translation between bytestreams and bitstreams.
Bitstreams and bytestreams are used extensively in
Relationship to bytestreams
In practice, bitstreams are not used directly to encode bytestreams; a communication channel may use a signalling method that does not directly translate to bits (for instance, by transmitting signals of multiple frequencies) and typically also encodes other information such as
Examples
The term bitstream is frequently used to describe the configuration data to be loaded into a
In mathematics, several specific
On most
Compression algorithms often code in bitstreams, as the 8 bits offered by a byte (the smallest addressable unit of memory) may be wasteful. Although typically implemented in low-level languages, some high-level languages such as Python[1] and Java[2] offer native interfaces for bitstream I/O.
One well-known example of a communication protocol which provides a byte-stream service to its clients is the Transmission Control Protocol (TCP) of the Internet protocol suite, which provides a bidirectional bytestream.
The
Flow control
Often the contents of a bytestream are dynamically created, such as the data from the keyboard and other peripherals (/dev/tty), data from the
In those cases, when the destination of a bytestream (the consumer) uses bytes faster than they can be generated, the system uses
When bytes are generated faster than the destination can use them and the producer is a software algorithm, the system pauses it with the same process synchronization techniques. When the producer supports
See also
References
- ^ "Bitstream". Python Software Foundation. Archived from the original on 2016-09-08.
- ^ "Class BitSet". Oracle. Archived from the original on 2016-11-30.