public static Stream ToBoxStream(Box item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } try { return(AmoebaConverter.ToStream <Box>(0, item)); } catch (Exception) { throw new FormatException(); } }
public static string ToSeedString(Seed item) { if (item == null) { throw new ArgumentNullException(nameof(item)); } try { using (var stream = AmoebaConverter.ToStream <Seed>(0, item)) { return("Seed:" + AmoebaConverter.ToBase64String(stream)); } } catch (Exception) { throw new FormatException(); } }