コード例 #1
0
        private static unsafe void WriteTinyMethodHeader(byte[] buffer, uint pos, TinyMethodHeader header)
        {
            fixed(byte *p = buffer)
            {
                TinyMethodHeader *ptr = (TinyMethodHeader *)(p + pos);

                *ptr = header;
            }
        }
コード例 #2
0
        private static unsafe TinyMethodHeader ReadTinyMethodHeader(byte[] buffer, uint pos)
        {
            TinyMethodHeader methodHeader = new TinyMethodHeader();

            fixed(byte *p = buffer)
            {
                TinyMethodHeader *ptr = (TinyMethodHeader *)(p + pos);

                methodHeader = *ptr;
            }

            return(methodHeader);
        }