private static unsafe void WriteTinyMethodHeader(byte[] buffer, uint pos, TinyMethodHeader header) { fixed(byte *p = buffer) { TinyMethodHeader *ptr = (TinyMethodHeader *)(p + pos); *ptr = header; } }
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); }