title: ByteBuffer getInt() question
body: <p>We are using Java ByteBuffer for socket communication with a C++ server. We know Java is Big-endian and Socket communication is also Big-endian. So whenever the byte stream received and put into a ByteBuffer by Java, we call getInt() to get the value. No problem, no conversion.</p>
  
  <p>But if somehow we specifically set the ByteBuffer byte order to Little-endian (my co-worker actually did this), </p>
  
  <ol>
  <li><p>will the Java automatically convert the Big-endian into the Little-endian when the data is put into the ByteBuffer? </p></li>
  <li><p>Then the getInt() of the Little-endian version will return a right value to you?</p></li>
  </ol>
  
  <p>I guess the answer to above two questions are yes. But when I try to verify my guessing and try to find how the getInt() works in ByteBuffer, I found it is an abstract method. The only subclass of ByteBuffer is the MappedByteBuffer class which didn't implement the abstract getInt(). So where is the implementation of the getInt() method?</p>
  
  <p>For the sending, because we are using Little-endian ByteBuffer, we need to convert them into a Big-endian bytes before we put onto the socket.</p>