internal static void SetRevID(this IDictionary<string, object> dict, RevisionID revId)
        {
            if(dict == null) {
                return;
            }

            dict["_rev"] = revId.ToString();
        }
        internal static void SetRevID(this IDictionary <string, object> dict, RevisionID revId)
        {
            if (dict == null)
            {
                return;
            }

            dict["_rev"] = revId.ToString();
        }
        internal Body(IEnumerable <byte> json, string docID, RevisionID revID, bool deleted)
        {
            var count = json.Count();

            if (json != null && count < 2)
            {
                _jsonObject = new NonNullDictionary <string, object> {
                    { "_id", docID },
                    { "_rev", revID.ToString() },
                    { "_deleted", deleted ? (object)true : null }
                };
                return;
            }

            var stringToAdd = String.Format("{{\"_id\":\"{0}\",\"_rev\":\"{1}\",{2}}}", docID, revID,
                                            deleted ? "\"_deleted\":true," : String.Empty);
            var bytes = Encoding.UTF8.GetBytes(stringToAdd).ToList();

            bytes.InsertRange(bytes.Count - 1, json.Skip(1).Take(count - 2));
            _json = bytes.ToArray();
        }