Example #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;
        }
Example #2
0
 public static int FromBytes <T>(this ArraySegment <byte> src, T[] dst) where T : struct
 {
     SafeMarshalCopy.CopyBytesToArray(src, dst);
     return(src.Count);
 }