Пример #1
0
        public unsafe static byte[] universalToBytes(this DateTime date)
        {
            byte[] data = ByteBuffers.Get();

            fixed(byte *fixedData = data) UniversalToBytes(date, fixedData);

            return(data);
        }
Пример #2
0
 /// <summary>
 /// 获取匹配值集合
 /// </summary>
 /// <param name="isValue">数据匹配器</param>
 /// <returns>匹配值集合</returns>
 public unsafe valueType[] GetFindArray(Func <valueType, bool> isValue)
 {
     if (isValue == null)
     {
         log.Error.Throw(log.exceptionType.Null);
     }
     if (this.length != 0)
     {
         int        length = ((this.length + 31) >> 5) << 2;
         memoryPool pool   = fastCSharp.memoryPool.GetDefaultPool(length);
         byte[]     data   = pool.Get(length);
         try
         {
             fixed(byte *dataFixed = data)
             {
                 System.Array.Clear(data, 0, length);
                 return(getFindArray(isValue, new fixedMap(dataFixed)));
             }
         }
         finally { pool.PushNotNull(data); }
     }
     return(nullValue <valueType> .Array);
 }