コード例 #1
0
        public static UserBinaryObject CreateUserBinaryObject(ICollection data, PoolManager poolManager = null)
        {
            if (data == null)
            {
                return(null);
            }

            if (data.Count > 1)
            {
                return(LargeUserBinaryObject.CreateUserBinaryObject(data, poolManager));
            }

            return(SmallUserBinaryObject.CreateUserBinaryObject(data, poolManager));
        }
コード例 #2
0
        /// <summary>
        /// Creates a UserBinaryObject from a byte array
        /// </summary>
        /// <param name="data"></param>
        public static UserBinaryObject CreateUserBinaryObject(byte[] byteArray, PoolManager poolManager = null)
        {
            if (byteArray == null)
            {
                return(null);
            }

            float noOfChunks = (float)byteArray.Length / LARGE_OBJECT_SIZE;

            if (noOfChunks > 1)
            {
                return(LargeUserBinaryObject.CreateUserBinaryObject(byteArray, poolManager));
            }

            return(SmallUserBinaryObject.CreateUserBinaryObject(byteArray, poolManager));
        }