add the buffer io function