fix resource leak
add ByteBuf test
fix unitest
fix unit test