public class ComStream : Stream
{
//The managed stream being wrapped private IStream originalStream_;
public ComStream(IStream stream)
{
if (stream != null)
{
originalStream_ = stream;
}
else
{
throw new ArgumentNullException("stream");
}
}
~ComStream()
{
Close();
}
// property to get original stream object public IStream UnderlyingStream
{
get
{
return originalStream_;
}
}
// reads a specified number of bytes from the stream object // into memory starting at the current seek pointer public unsafe override int Read(byte[] buffer, int offset, int count)
{
if (originalStream_ == null)
{
throw new Object