Fix memcpy and memcmp size bugs in Buffer.h

The last parameter of `memcpy` and `memcmp` should be numbers of byte, fixed by added `* sizeof(T)`.