#1348: use buffered io