title: Java NIO Issue on CharBuffer
body: <p>I am using following code to read a sub-sequence from a file. </p>
  
  <pre><code>FileChannel channel = new RandomAccessFile("abc.txt", "r").getChannel();
  ByteBuffer buffer = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
  CharBuffer cbuf = buffer.asCharBuffer();
  
  String str = cbuf.subSequence(0, 1).toString();
  System.out.println("str = " + str);
  </code></pre>
  
  <p>However, this gives output "str = ?" Can anybody help me why is this happening and how to solve this ? Sorry, I am new in NIO.</p>
  
  <p>Additional thing, when I add System.out.println(buffer); it gives output "java.nio.DirectByteBufferR[pos=0 lim=16 cap=16]".</p>
  
  <p>System.out.println((char)buffer.get(0)) gives proper output means 1st character.</p>