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

Function writeBits

static/webuploader/webuploader.js:5785–5807  ·  view source on GitHub ↗
(bs)

Source from the content-addressed store, hash-verified

5783
5784 // IO functions
5785 function writeBits(bs)
5786 {
5787 var value = bs[0];
5788 var posval = bs[1]-1;
5789 while ( posval >= 0 ) {
5790 if (value & (1 << posval) ) {
5791 bytenew |= (1 << bytepos);
5792 }
5793 posval--;
5794 bytepos--;
5795 if (bytepos < 0) {
5796 if (bytenew == 0xFF) {
5797 writeByte(0xFF);
5798 writeByte(0);
5799 }
5800 else {
5801 writeByte(bytenew);
5802 }
5803 bytepos=7;
5804 bytenew=0;
5805 }
5806 }
5807 }
5808
5809 function writeByte(value)
5810 {

Callers 2

processDUFunction · 0.70
JPEGEncoderFunction · 0.70

Calls 1

writeByteFunction · 0.70

Tested by

no test coverage detected