//----------------------------------------------------------------------------- // openCompressingOStream //----------------------------------------------------------------------------- /// <summary> /// Open a compressing output stream. Data is compressed before writing it /// out to the passed in output stream object. /// </summary> /// <param name="inputOStream"> /// Output stream that the data is ultimately going to be written to - but it /// will be compressed before being written. /// </param> /// <returns> /// Returns an <see cref="OStream"/> object that can then be passed to /// methods which require an OStream object. /// </returns> public OStream openCompressingOStream( OStream inputOStream) { RCODE rc; IntPtr pOStream = IntPtr.Zero; if ((rc = xflaim_DbSystem_openCompressingOStream( m_pDbSystem, inputOStream.getOStream(), out pOStream)) != 0) { throw new XFlaimException( rc); } return( new OStream( pOStream, this)); }
//----------------------------------------------------------------------------- // writeToOStream //----------------------------------------------------------------------------- /// <summary> /// Read data from an input stream and write it out to an output stream. This /// is a quick way to copy all data from an input stream to an output stream. /// </summary> /// <param name="istream"> /// Input stream data is to be read from. /// </param> /// <param name="ostream"> /// Output stream data is to be written to. /// </param> public void writeToOStream( IStream istream, OStream ostream) { RCODE rc; if ((rc = xflaim_DbSystem_writeToOStream( m_pDbSystem, istream.getIStream(), ostream.getOStream())) != 0) { throw new XFlaimException( rc); } }
//----------------------------------------------------------------------------- // openBufferedOStream //----------------------------------------------------------------------------- /// <summary> /// Open a buffered output stream. A buffer is allocated for writing data to /// the original output stream. Instead of writing small chunks of data to /// the original output stream, it is first gathered into the output buffer. /// When the output buffer fills, the entire buffer is sent to the original /// output stream with a single write. The idea is that by buffering the /// output data, performance can be improved. /// </summary> /// <param name="inputOStream"> /// Output stream that the data is ultimately going to be written to - but it /// will be buffered before being written. /// </param> /// <param name="uiBufferSize"> /// Size of the buffer to be used for buffering output. /// </param> /// <returns> /// Returns an <see cref="OStream"/> object that can then be passed to /// methods which require an OStream object. /// </returns> public OStream openBufferedOStream( OStream inputOStream, uint uiBufferSize) { RCODE rc; IntPtr pOStream = IntPtr.Zero; if ((rc = xflaim_DbSystem_openBufferedOStream( m_pDbSystem, inputOStream.getOStream(), uiBufferSize, out pOStream)) != 0) { throw new XFlaimException( rc); } return( new OStream( pOStream, this)); }