Ejemplo n.º 1
0
        public static Stream ToBoxStream(Box item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            try
            {
                return(AmoebaConverter.ToStream <Box>(item));
            }
            catch (Exception)
            {
                throw new FormatException();
            }
        }
Ejemplo n.º 2
0
        public static string ToSeedString(Seed item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            try
            {
                using (Stream stream = AmoebaConverter.ToStream <Seed>(item))
                {
                    return("Seed:" + AmoebaConverter.ToBase64String(stream));
                }
            }
            catch (Exception)
            {
                throw new FormatException();
            }
        }