Tiernan's Comms Closet

Geek, Programmer, Photographer…

Compressing and UnCompressing Protobuf items in C#

Part of a project i am working on required sending large amounts of data between different instances. To get this to work efficially, we started using the ProtoBuf using ProtoBuf-net in .NET. but the files where still quite large (17mb, give or take). So, we looked into compression…

here is some examples of how we managed to compress the protobuf files. We got some decient compression: 3mb files, down from 17mb. very happy.

to compress an object (obj) and write to a temp file (tmpfile):

to decompress the object back to a known type:



“Compressing and UnCompressing Protobuf items in C#” was last updated: July 13, 2018: fixing aliases (c8b9f0d). Found an issue? Improve this page