add new version processFileBuffer to improve performance