public static byte[] ToBytes(this IBFast bf) { using (var mem = new MemoryStream()) { bf.Write(mem); return(mem.ToArray()); } }
public static void WriteToFile(this IBFast bf, string path) { using (var f = File.OpenWrite(path)) bf.Write(f); }
public static Stream Write(this IBFast bf, Stream stream) { using (var bw = new BinaryWriter(stream)) bf.Write(bw); return(stream); }