Ejemplo n.º 1
0
        public Char[] ToBase256()
        {
            using (MemoryStream ms = new MemoryStream(4 + 4 * (_properties?.Length ?? 0) + 4 * (_fields?.Length ?? 0) + 4 * (_methods?.Length ?? 0)))
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    Serialize(bw);
                    bw.Flush();

                    return(Base256.Encode(ms.GetBuffer(), 0, (Int32)ms.Length));
                }
        }
Ejemplo n.º 2
0
        public static TypeHash FromBase256(String base64String)
        {
            if (base64String == null)
            {
                return(null);
            }

            using (MemoryStream ms = new MemoryStream(Base256.Decode(base64String)))
                using (BinaryReader br = new BinaryReader(ms))
                {
                    TypeHash hash = new TypeHash();
                    hash.Deserialize(br);
                    return(hash);
                }
        }