NCache 4.6 - Online Documentation

Retrieving Data from Streams

To read data from streams, open stream in any read mode and simply read data from it.
Read mode can either be acquired with or without lock. In read with lock mode, multiple read operations can be performed simultaneously on a stream but no write operation is allowed in this mode. While in read without lock, write operations can be done in parallel to read operations.
       To utilize the API, include the following namespace in your application: Alachisoft.NCache.Web.Caching. 
            string key = "key:ncache-manual";
                CacheStream cacheStream = cache.GetCacheStream(key, StreamMode.Read);
                int dataSize = Convert.ToInt32(cacheStream.Length);
                byte[] dataToRead = new byte[dataSize];
                cacheStream.Read(dataToRead, 0, dataSize);
                //...Close stream
            catch (StreamException e)
                // handle exception
See Also