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

            EnsureBufferSize(_lengthBits + bits);
            BitReaderWriter.WriteBytes(source, offsetInBytes, numberOfBytes, _data, _lengthBits);
            _lengthBits += bits;

            return(this);
        }
Beispiel #2
0
        /// <summary>
        /// Writes all bytes in an array
        /// </summary>
        public BitWriter Write(byte[] source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }
            int bits = source.Length * 8;

            EnsureBufferSize(_lengthBits + bits);
            BitReaderWriter.WriteBytes(source, 0, source.Length, _data, _lengthBits);
            _lengthBits += bits;

            return(this);
        }