示例#1
0
        public void ReadToArray <T>(T[] dst) where T : struct
        {
            var bytes = new ArraySegment <Byte>(m_bytes, m_pos, m_bytes.Length - m_pos);

            SafeMarshalCopy.CopyBytesToArray(bytes, dst);
            m_pos += bytes.Count;
        }
示例#2
0
 public static int ToBytes <T>(this T[] src, ArraySegment <byte> dst) where T : struct
 {
     SafeMarshalCopy.CopyArrayToToBytes(src, dst);
     return(dst.Count);
 }
示例#3
0
 public static int FromBytes <T>(this ArraySegment <byte> src, T[] dst) where T : struct
 {
     SafeMarshalCopy.CopyBytesToArray(src, dst);
     return(src.Count);
 }