public override void Write(byte[] buffer, int offset, int count)
        {
            if (m_disposed)
            {
                throw new ObjectDisposedException(this.ToString());
            }

            m_buffer.Write(buffer, offset, count);

            while (m_buffer.Length >= FrameSize)
            {
                EncodeAndWritePacket();
            }

            m_totalWritten += count;
        }