/// <exception cref="System.IO.IOException"/>
        public static void WriteCachePoolInfo(DataOutputStream @out, CachePoolInfo info)
        {
            WriteString(info.GetPoolName(), @out);
            string       ownerName         = info.GetOwnerName();
            string       groupName         = info.GetGroupName();
            long         limit             = info.GetLimit();
            FsPermission mode              = info.GetMode();
            long         maxRelativeExpiry = info.GetMaxRelativeExpiryMs();
            bool         hasOwner;
            bool         hasGroup;
            bool         hasMode;
            bool         hasLimit;
            bool         hasMaxRelativeExpiry;

            hasOwner             = ownerName != null;
            hasGroup             = groupName != null;
            hasMode              = mode != null;
            hasLimit             = limit != null;
            hasMaxRelativeExpiry = maxRelativeExpiry != null;
            int flags = (hasOwner ? unchecked ((int)(0x1)) : 0) | (hasGroup ? unchecked ((int)(
                                                                                             0x2)) : 0) | (hasMode ? unchecked ((int)(0x4)) : 0) | (hasLimit ? unchecked ((int)
                                                                                                                                                                          (0x8)) : 0) | (hasMaxRelativeExpiry ? unchecked ((int)(0x10)) : 0);

            WriteInt(flags, @out);
            if (hasOwner)
            {
                WriteString(ownerName, @out);
            }
            if (hasGroup)
            {
                WriteString(groupName, @out);
            }
            if (hasMode)
            {
                mode.Write(@out);
            }
            if (hasLimit)
            {
                WriteLong(limit, @out);
            }
            if (hasMaxRelativeExpiry)
            {
                WriteLong(maxRelativeExpiry, @out);
            }
        }