fix the bug which the offset beyond buffer length, the offset should be 0 every time, and use the increase posision to travel the file instead of using offset in buffer
Merge pull request #1 from yclod/master

fix the bug which the offset beyond buffer length