I want to create a std::istream object with a stream buffer object that can take raw byte data from array of unsigned char. I searched and found this Link
However they create the stream buffer based on array char:
struct membuf : std::streambuf
{
membuf(char* begin, char* end) {
this->setg(begin, begin, end);
}
};
I thought about type caste , but i don't want to modify the original data.So how i can it be done using unsigned char.