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); }
public static void Clear(RawMessage rawMessage) { BufferObjectCache.Free(rawMessage); }