Bitwise IO: Difference between revisions

Content added Content deleted
Line 1,454: Line 1,454:


=={{header|Julia}}==
=={{header|Julia}}==

ASCII 7-bit character string compression and decompression, to demonstrate bit twiddling. Implemented as generic IO, so that file handles are usable with the same functions.
ASCII 7-bit character string compression and decompression, to demonstrate bit twiddling. Implemented as generic IO, so that file handles are usable with the same functions.
<lang Julia>
<lang Julia>
Line 1,505: Line 1,504:
println("Compressed to length $(length(outs.data)) on line below:\n", String(outs.data))
println("Compressed to length $(length(outs.data)) on line below:\n", String(outs.data))
println("Decompressed string: ", String(newouts.data))
println("Decompressed string: ", String(newouts.data))
</lang>
</lang> {{out}} <pre>
{{data}}
<pre>
Initial string of length 88: These bit oriented I/O functions can be used to implement compressors and decompressors.
Initial string of length 88: These bit oriented I/O functions can be used to implement compressors and decompressors.
Compressed to length 77 on line below:
Compressed to length 77 on line below: