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