Skip to content
Update cpp authored by umaumax's avatar umaumax
......@@ -1855,12 +1855,12 @@ bool IsFileExist(const std::string &filename) {
* ファイル/ディレクトリが存在: true
* シンボリックリンクの場合はその参照先に依存
### ファイルを読みたい
### 🌟ファイルを読みたい
* [How to read a file from disk to std::vector\<uint8\_t> in C\+\+]( https://gist.github.com/looopTools/64edd6f0be3067971e0595e1e4328cbc )
* [c++ - How to read a binary file into a vector of unsigned chars - Stack Overflow]( https://stackoverflow.com/questions/15138353/how-to-read-a-binary-file-into-a-vector-of-unsigned-chars )
* なぜか、`std::istream_iterator`を利用すると、ファイルの読み込みサイズが小さくなってしまう現象が発生した
* 理由は`\n`をスキップして`std::vector`へ保存してしまうためである
* __なぜか、`std::istream_iterator`を利用すると、ファイルの読み込みサイズが小さくなってしまう現象が発生した__
* __理由は`\n`をスキップして`std::vector`へ保存してしまうためである__
* `std::istreambuf_iterator`には`uint8_t`は指定できない
``` cpp
......
......