title: Read Binary file using MsgPack in C++
body: <p>I want to read a binary file using Cpp, and its type is using <a href="http://msgpack.org/index.html" rel="nofollow noreferrer">MsgPack</a>.
  I'm not familiar with MsgPack and I try to read binary file fist and push in MsgPack. It doesn't work. It just gets the first number again and again. Can anyone help? Thanks a lot.</p>
  
  <pre><code>#include &lt;bits/stdc++.h&gt;
  #include &lt;msgpack.hpp&gt;
  using namespace std;
  
  int main()
  {
      std::ifstream ifs("input.txt", std::ifstream::in);
      std::stringstream buffer;
      buffer &lt;&lt; ifs.rdbuf();
      msgpack::unpacked upd;
      msgpack::unpack(upd, buffer.str().data(), buffer.str().size());
      std::cout &lt;&lt; upd.get() &lt;&lt; std::endl;
      return 0;
  }
  </code></pre>
  
  <p>Which it can just get the first number "3".</p>
  
  <p>I'm hoping to get number:</p>
  
  <pre><code>3
  [3 6 7 5 3 5]
  [6 2 9 1 2 7]
  [0 9 3 6 0 6]
  </code></pre>
  
  <p>And <a href="https://github.com/calee0219/Programming/blob/master/COURSE/Algo/hw2/input.txt" rel="nofollow noreferrer">here</a> is the input binary file.</p>