Optimization: reading just first N bytes of file