read with buffer