MCPcopy Create free account
hub / github.com/TruthHun/BookStack / writeBits

Function writeBits

static/webuploader/webuploader.fis.js:5760–5782  ·  view source on GitHub ↗
(bs)

Source from the content-addressed store, hash-verified

5758
5759 // IO functions
5760 function writeBits(bs)
5761 {
5762 var value = bs[0];
5763 var posval = bs[1]-1;
5764 while ( posval >= 0 ) {
5765 if (value & (1 << posval) ) {
5766 bytenew |= (1 << bytepos);
5767 }
5768 posval--;
5769 bytepos--;
5770 if (bytepos < 0) {
5771 if (bytenew == 0xFF) {
5772 writeByte(0xFF);
5773 writeByte(0);
5774 }
5775 else {
5776 writeByte(bytenew);
5777 }
5778 bytepos=7;
5779 bytenew=0;
5780 }
5781 }
5782 }
5783
5784 function writeByte(value)
5785 {

Callers 2

processDUFunction · 0.70
JPEGEncoderFunction · 0.70

Calls 1

writeByteFunction · 0.70

Tested by

no test coverage detected