extract method and use bytes.NewReader() to interface byte[]

ReadEntity() is modified without touching cachingReadEntity(). So the problem exists if we didn't call SetCacheReadEntity(false). Therefore the behavior is inconsistent.

This pr extracts the decoding process, also attached with test case.