public static Stream ToBoxStream(Box item) { if (item == null) { throw new ArgumentNullException("item"); } try { return(AmoebaConverter.ToStream <Box>(item)); } catch (Exception) { throw new FormatException(); } }
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(); } }