Ejemplo n.º 1
0
        /// <summary>
        /// Writes the specified number of bytes from an array
        /// </summary>
        public void Write(byte[] source, int offsetInBytes, int numberOfBytes)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            int bits = numberOfBytes * 8;

            EnsureBufferSize(m_bitLength + bits);
            NetBitWriter.WriteBytes(source, offsetInBytes, numberOfBytes, m_data, m_bitLength);
            m_bitLength += bits;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes all bytes in an array
        /// </summary>
        public void Write(byte[] source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            int bits = source.Length * 8;

            EnsureBufferSize(m_bitLength + bits);
            NetBitWriter.WriteBytes(source, 0, source.Length, m_data, m_bitLength);
            m_bitLength += bits;
        }