add i/o method and buffer