optimized readbin

now it runs in incremental mode, that is significantly faster.