Add support of RBuffer instead of FILE

use r_buf_seek and r_buf_read