Implement some useful variants: MemorySink and StringSink (next: VectorSink)
Change the SjpegEncode() signature to take a string* instead of returning a string
Rationalize the Memory allocation: all internal buffers pass through
the Alloc() and Free() functions, so we can later track or limit allocation
traffic.
Protect all new[] with (std::nothrow) and catch the error.
polished the bit_writer.h/cc code.
TODO(after): move the ByteSink declaration to a public header (like: sjpeg.h) for exposure.
Implement some useful variants: MemorySink and StringSink (next: VectorSink)
Rationalize the Memory allocation: all internal buffers pass through the Alloc() and Free() functions, so we can later track or limit allocation traffic.
Protect all new[] with (std::nothrow) and catch the error.
TODO(after): move the ByteSink declaration to a public header (like: sjpeg.h) for exposure.
Change-Id: I6e1b3cee8f62af12e60a1e40b64e8e5e23102798