Does BinaryFormatter apply any compression?
问题 When .NET's BinaryFormatter is used to serialize an object graph, is any type of compression applied? I ask in the context of whether I should worry about the object graph having many repeated strings and integers. Edit - Hold on, if strings are interned in .NET, there's no need to worry about repeated strings, right? 回答1: No, it doesn't provide any compression but you can compress the output yourself using the GZipStream type. Edit: Mehrdad has a wonderful example of this technique in his