ensure input is a Buffer