[ailyasov] hw2_6: fix issue with 4 extra bytes; fix compiler warnings; add general method for binary save/read of primitive types.