title: C++ network stream
body: <p>I am a newbie using C++ and I have a background with Java</p>
  
  <p>I am working on a simple linux server using c++ and I have a question about converting byte data.</p>
  
  <p>In Java, I can use putShort, or putString in ByteBuffer and simply send the buffer over socket using byteBuffer.array() </p>
  
  <p>What is the corresponding c++ code of this? </p>
  
  <p>Thanks in advance.</p>