/// <summary> /// Creates a UserBinaryObject from a byte array /// </summary> /// <param name="data"></param> /// <returns></returns> public static SmallUserBinaryObject CreateUserBinaryObject(byte[] byteArray) { SmallUserBinaryObject binaryObject = null; if (byteArray != null) { binaryObject = new SmallUserBinaryObject(byteArray); } return binaryObject; }
public static SmallUserBinaryObject CreateUserBinaryObject(Array data) { SmallUserBinaryObject binaryObject = null; foreach (byte[] buffer in data) { binaryObject = new SmallUserBinaryObject(buffer); break; } return binaryObject; }
/// <summary> /// Creates a UserBinaryObject from a byte array /// </summary> /// <param name="data"></param> /// <returns></returns> public static SmallUserBinaryObject CreateUserBinaryObject(byte[] byteArray) { SmallUserBinaryObject binaryObject = null; if (byteArray != null) { binaryObject = new SmallUserBinaryObject(byteArray); } return(binaryObject); }
public static SmallUserBinaryObject CreateUserBinaryObject(Array data) { SmallUserBinaryObject binaryObject = null; foreach (byte[] buffer in data) { binaryObject = new SmallUserBinaryObject(buffer); break; } return(binaryObject); }
public static SmallUserBinaryObject CreatePooledUserBinaryObject(ICollection data) { SmallUserBinaryObject binaryObject = null; foreach (byte[] buffer in data) { binaryObject = ObjectPooling.ObjectPoolManager.PayloadObjectPool.GetObject(); byte[] pooledBuffer = binaryObject.Bytes; Buffer.BlockCopy(buffer, 0, pooledBuffer, 0, pooledBuffer.Length); break; } return(binaryObject); }
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); }
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); }
/// <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); }