예제 #1
0
        public QueryResponse Query(QueryRequest qr)
        {
            uint size = (uint)qr.CalculateSize();

            byte[]            bytes = new byte[size];
            CodedOutputStream cos   = new CodedOutputStream(bytes);

            qr.WriteTo(cos);
            cos.Flush();
            string     s2   = System.Text.Encoding.ASCII.GetString(bytes);
            VectorByte vb   = new VectorByte(bytes);
            VectorByte resp = cache.query(vb, size);

            byte[] respBytes = new byte[resp.Count];
            resp.CopyTo(respBytes);
            QueryResponse queryResp = new QueryResponse();

            return(QueryResponse.Parser.ParseFrom(respBytes));
        }