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

Function writeBits

static/webuploader/webuploader.custom.js:5796–5818  ·  view source on GitHub ↗
(bs)

Source from the content-addressed store, hash-verified

5794
5795 // IO functions
5796 function writeBits(bs)
5797 {
5798 var value = bs[0];
5799 var posval = bs[1]-1;
5800 while ( posval >= 0 ) {
5801 if (value & (1 << posval) ) {
5802 bytenew |= (1 << bytepos);
5803 }
5804 posval--;
5805 bytepos--;
5806 if (bytepos < 0) {
5807 if (bytenew == 0xFF) {
5808 writeByte(0xFF);
5809 writeByte(0);
5810 }
5811 else {
5812 writeByte(bytenew);
5813 }
5814 bytepos=7;
5815 bytenew=0;
5816 }
5817 }
5818 }
5819
5820 function writeByte(value)
5821 {

Callers 2

processDUFunction · 0.70
JPEGEncoderFunction · 0.70

Calls 1

writeByteFunction · 0.70

Tested by

no test coverage detected