Collection of useful functions operating on buffers