Apply MR suggestions regarding the use of nextUnprocessedpiece
Apply MR suggestions regarding the use of nextUnprocessedpiece

Also refactor and combine npos-processed pos limit for both GET and PUT.

meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk,meganz/sdk