better ber support for bytes buffer