Code example for CharBuffer

Methods: put

0
		byteBuffer.put(2, (byte) 0);
		byteBuffer.put(3, (byte) 'i');
		byteBuffer.put(4, (byte) 0);
		byteBuffer.put(5, (byte) '!');
		byteBuffer.put(6, (byte) 0);
		charBuffer.put(1, 'W');
		println(byteBuffer);
		println(charBuffer);
		println(intBuffer);
	} 
 
	private static void println(Buffer buffer) {
		System.out.println("pos=" + buffer.position() + ", limit="
				+ buffer.limit() + ", capacity=" + buffer.capacity() + ": '"
				+ buffer.toString() + "'");
	} 
}