converts buffer to stream from cache