Como ler um arquivo em matriz de caracteres não assinados de std :: ifstream?
Então normalmente eu faço coisas como:
<code> std::ifstream stream; int buff_length = 8192; boost::shared_array<char> buffer( new char[buff_length]); stream.open( path.string().c_str(), std::ios_base::binary); while (stream) { stream.read(buffer.get(), buff_length); //boost::asio::write(*socket, boost::asio::buffer(buffer.get(), stream.gcount())); } stream.close(); </code>
Eu me pergunto como lerunsigned char
amortecedor (boost::shared_array<unsigned char> buffer( new unsigned char[buff_length]);
)