I have the following code.
String s="AAAA"
ByteBuffer newBuffer = ByteBuffer.allocate(100);
CharBuffer cbuf = newBuffer.asCharBuffer();
for (char c : s.toCharArray()) {
cbuf.put(c);
}
When I get the cbuf it's in the form 0 , 65 , 0 , 65 , 0 , 65 , 0 , 65.Why there are additional zeros in cbuf (CharBuffer)?