/// <summary> /// Parse a node from the specified string. /// </summary> protected NodeSerialization(string json) { var ms = MemoryStreamCache.Get(json.Length); var bytes = Encoding.UTF8.GetBytes(json); ms.Write(bytes, 0, bytes.Length); _stream = new ByteBuffer(ms); _builder = new StringBuilder(); Node = ParseNode(new Node()); MemoryStreamCache.Set(ms); }
public CbzPage(ZipArchiveEntry entry) { Content = entry; Cache = new MemoryStreamCache() { MemoryStreamProvider = async(th) => { using (var s = Content.Open()) { return(await th.GetMemoryStreamAsync(s)); } } }; }