示例#1
0
        public static RawMessage Clone(byte[] data, int offset, int length, int capacity)
        {
            RawMessage message = BufferObjectCache.Alloc <RawMessage>(capacity);

            if (null == data)
            {
                message.size = 0;
                return(message);
            }

            message.size = length;
            Buffer.BlockCopy(data, offset, message.buffer, 0, length);
            return(message);
        }
示例#2
0
 public static void Clear(RawMessage rawMessage)
 {
     BufferObjectCache.Free(rawMessage);
 }