Modify return void for methods serializeToByteBuf and
serializeToByteBuffer.