C# packing and unpacking