refactoring 2
first version of new BinaryBuffer