Example #1
0
 private void AddNodeName(string name)
 {
     if (compressed)
     {
         nodeBuf.AddBytes(SixBit.Pack(name));
     }
     else
     {
         byte[] bytes = BinEncoding.GetBytes(name);
         nodeBuf.AddU8((byte)((bytes.Length - 1) | 64));
         nodeBuf.AddBytes(bytes);
     }
 }
Example #2
0
        private string GetNodeName(byte nodeType)
        {
            if (nodeType != XmlType.NodeEndType && nodeType != XmlType.SectionEndType)
            {
                if (compressed)
                {
                    return(SixBit.Unpack(nodeBuf));
                }
                else
                {
                    int    length    = (nodeBuf.TakeU8() & ~64) + 1;
                    byte[] nameBytes = nodeBuf.TakeBytes(length);

                    return(BinEncoding.GetString(nameBytes));
                }
            }
            else
            {
                return("");
            }
        }