fixing pherialize long int

- Unserialize integer falls to try long int
- fix serialize long int which should be type `i`, `d` is for double
In order to eliminate duplication you can extract `this.data.substring(this.pos + 2, pos)` before try block.