[refactory] extract method, use bytes.NewReader() to interfce byte[]
add test case
Merge pull request #151 from clsung/cache_use_decoder

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