added some tests from Martin Thompson. also measured time to copy a CharBuffer before access it and found that on my hardware it was faster than accessing it directly