low level read and write