示例#1
0
        public static UserBinaryObject CreateUserBinaryObject(Array data)
        {
            UserBinaryObject binaryObject = null;

            if (data != null)
            {
                if (data.Length > 1)
                {
                    binaryObject = LargeUserBinaryObject.CreateUserBinaryObject(data);
                }
                else
                {
                    binaryObject = SmallUserBinaryObject.CreateUserBinaryObject(data);
                }
            }

            return(binaryObject);
        }
示例#2
0
        public static UserBinaryObject CreateUserBinaryObject(ICollection data)
        {
            UserBinaryObject binaryObject = null;

            if (data != null)
            {
                if (data.Count > 1)
                {
                    binaryObject = LargeUserBinaryObject.CreateUserBinaryObject(data);
                }
                else
                {
                    binaryObject = SmallUserBinaryObject.CreateUserBinaryObject(data);
                }
            }

            return(binaryObject);
        }
示例#3
0
        /// <summary>
        /// Creates a UserBinaryObject from a byte array
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public static UserBinaryObject CreateUserBinaryObject(byte[] byteArray)
        {
            UserBinaryObject binaryObject = null;

            if (byteArray != null)
            {
                float noOfChunks = (float)byteArray.Length / (float)LARGE_OBJECT_SIZE;

                if (noOfChunks < 1.0)
                {
                    binaryObject = SmallUserBinaryObject.CreateUserBinaryObject(byteArray);
                }
                else
                {
                    binaryObject = LargeUserBinaryObject.CreateUserBinaryObject(byteArray);
                }
            }

            return(binaryObject);
        }