예제 #1
0
 public static unsafe byte[] ReadBytes(BufferSegment buf, ref int offset, int len)
 {
     byte[] ret = new byte[len];
     //Marshal.Copy((IntPtr)(void*)(buf + offset), ret, 0, len);
     buf.CopyToBytes(offset, ret, 0, len);
     offset += len;
     return(ret);
 }
예제 #2
0
            public static unsafe byte[] ReadBytes1(BufferSegment buf, ref int offset)
            {
                int len = ReadByte(buf, ref offset);

                byte[] ret = new byte[len];
                buf.CopyToBytes(0, ret, 0, len);
                offset += len;
                return(ret);
            }
예제 #3
0
 public static unsafe byte[] ReadBytes4(BufferSegment buf, ref int offset)
 {
     int len = ReadInt32(buf, ref offset);
     byte[] ret = new byte[len];
     // Marshal.Copy((IntPtr)(void*)(buf + offset), ret, 0, len);
     buf.CopyToBytes(offset, ret, 0, len);
     offset += len;
     return ret;
 }
예제 #4
0
 public static unsafe byte[] ReadBytes1(BufferSegment buf, ref int offset)
 {
     int len = ReadByte(buf, ref offset);
     byte[] ret = new byte[len];
     buf.CopyToBytes(0, ret, 0, len);
     offset += len;
     return ret;
 }