Ejemplo n.º 1
0
        private static void WriteAligned(BlobWriter source, BlobWriter target)
        {
            int length = source.Length;

            source.WriteTo(target);
            target.Write(0, BitArithmeticUtilities.Align(length, 4) - length);
        }
        public void WriteData(BlobWriter resourceWriter)
        {
            if (_fileReference == null)
            {
                try
                {
                    using (Stream stream = _streamProvider())
                    {
                        if (stream == null)
                        {
                            throw new InvalidOperationException(CodeAnalysisResources.ResourceStreamProviderShouldReturnNonNullStream);
                        }

                        var count = (int)(stream.Length - stream.Position);
                        resourceWriter.WriteInt(count);

                        resourceWriter.Write(stream, count);
                        resourceWriter.Align(8);
                    }
                }
                catch (Exception e)
                {
                    throw new ResourceException(_name, e);
                }
            }
        }
Ejemplo n.º 3
0
        public void WriteData(BlobWriter resourceWriter)
        {
            if (_fileReference == null)
            {
                try
                {
                    using (Stream stream = _streamProvider())
                    {
                        if (stream == null)
                        {
                            throw new InvalidOperationException(CodeAnalysisResources.ResourceStreamProviderShouldReturnNonNullStream);
                        }

                        var count = (int)(stream.Length - stream.Position);
                        resourceWriter.WriteInt(count);

                        resourceWriter.Write(stream, count);
                        resourceWriter.Align(8);
                    }
                }
                catch (Exception e)
                {
                    throw new ResourceException(_name, e);
                }
            }
        }
Ejemplo n.º 4
0
 internal void WriteTo(BlobWriter stream)
 {
     stream.Write(this.Buffer, 0, (int)this.Length);
 }
 internal void WriteTo(BlobWriter stream)
 {
     stream.Write(_buffer, 0, _length);
 }
Ejemplo n.º 6
0
 internal void WriteTo(BlobWriter stream)
 {
     stream.Write(_buffer, 0, _length);
 }