add some methods to binbuffer