Exemplo n.º 1
0
        public void Write(NPOIFSStream stream)
        {
            Stream os = stream.GetOutputStream();

            try
            {
                //Leon ByteArrayOutputStream  -->MemoryStream
                MemoryStream ms = new MemoryStream();
                foreach (Property property in _properties)
                {
                    if (property != null)
                    {
                        property.WriteData(os);
                    }
                }

                os.Dispose();

                // Update the start position if needed
                if (StartBlock != stream.GetStartBlock())
                {
                    StartBlock = stream.GetStartBlock();
                }
            }
            catch (System.IO.IOException ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public void Write(NPOIFSStream stream)
        {
            Stream os = stream.GetOutputStream();
            try
            {
                //Leon ByteArrayOutputStream  -->MemoryStream
                MemoryStream ms = new MemoryStream();
                foreach (Property property in _properties)
                {
                    if (property != null)
                        property.WriteData(os);
                }

                os.Close();

                // Update the start position if needed
                if (StartBlock != stream.GetStartBlock())
                {
                    StartBlock = stream.GetStartBlock();
                }
            }
            catch (System.IO.IOException ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public override void Write(byte[] b, int off, int len)
        {
            dieIfClosed();

            if (_buffer != null)
            {
                _buffer.Write(b, off, len);
                CheckBufferSize();
            }
            else
            {
                if (_stream == null)
                {
                    _stream = new NPOIFSStream(_document.FileSystem);
                    _stream_output = _stream.GetOutputStream();
                }
                _stream_output.Write(b, off, len);
                _document_size += len;
            }
        }