public static void PackObject(BinaryWriter writer, IBinarySerializable serializableObj) { if (serializableObj == null) { writer.Write(string.Empty); //throw new Exception("Попытка упаковать NULL"); } else { serializableObj.Pack(writer); } }