MCPcopy Create free account
hub / github.com/davisking/dlib / set_stream

Method set_stream

dlib/entropy_decoder/entropy_decoder_kernel_2.cpp:53–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51// ----------------------------------------------------------------------------------------
52
53 void entropy_decoder_kernel_2::
54 set_stream (
55 std::istream& in_
56 )
57 {
58 r = 0;
59 low = initial_low;
60 high = initial_high;
61 target = 0x00000000;
62
63 in = &in_;
64 streambuf = in_.rdbuf();
65
66
67
68 unsigned char ch;
69
70
71 streambuf->sgetn((char*)&ch,1);
72 target = ch;
73
74 target <<= 8;
75 if (streambuf->sgetn((char*)&ch,1))
76 target += ch;
77
78
79 target <<= 8;
80 if (streambuf->sgetn((char*)&ch,1))
81 target += ch;
82
83
84 target <<= 8;
85 if (streambuf->sgetn((char*)&ch,1))
86 target += ch;
87 }
88
89// ----------------------------------------------------------------------------------------
90

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected