Created
April 25, 2012 00:35
-
-
Save davidgrenier/2484918 to your computer and use it in GitHub Desktop.
Serialize/Deserialize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let szer = System.Runtime.Serialization.Formatters.Binary.BinaryFormatter() | |
let inline serialize obj f = | |
use str = System.IO.File.Create f | |
szer.Serialize(str, obj) | |
let inline deserialize f = | |
use rdr = System.IO.File.OpenRead f | |
szer.Deserialize rdr |> unbox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment