Fix copy function bug and add copy(ByteBuffer&), Update the Test
Merge remote-tracking branch 'origin/master'