public static void AddStream(Stream stream)
{
if (stream==null)
throw new ArgumentNullException("stream");
if (m_iStreamArraySize <= m_iNumOfStreamDevices)
{
// increase array size in chunks of 4
Stream[] newArray = new Stream [m_iStreamArraySize+4];
// copy the old array objects into the new one.
if (m_iNumOfStreamDevices > 0)
Array.Copy(m_rgStream, newArray, m_iNumOfStreamDevices);
m_iStreamArraySize += 4;
m_rgStream = newArray;
}
m_rgStream [m_iNumOfStreamDevices++] = stream;
}