Esempio n. 1
0
 /// <summary>
 /// Append the provided data to stream data.
 /// </summary>
 /// <example>
 /// <code>
 ///    byte[] b = new byte[]{0x0,0x1,0x2,0x3};
 ///    byte[] b2 = new byte[]{0x4,0x5,0x6,0x7};
 ///    CompoundFile cf = new CompoundFile();
 ///    CFStream myStream = cf.RootStorage.AddStream("MyStream");
 ///    myStream.SetData(b); // here we could also have invoked .AppendData
 ///    myStream.AppendData(b2);
 ///    cf.Save("MyLargeStreamsFile.cfs);
 ///    cf.Close();
 /// </code>
 /// </example>
 /// <param name="data">Data bytes to append to this stream</param>
 /// <remarks>
 /// This method allows user to create stream with more than 2GB of data,
 /// appending data to the end of existing ones.
 /// Large streams (>2GB) are only supported by CFS version 4.
 /// Append data can also be invoked on streams with no data in order
 /// to simplify its use inside loops.
 /// </remarks>
 public void Append(byte[] data)
 {
     CheckDisposed();
     if (Size > 0)
     {
         CompoundFile.AppendData(this, data);
     }
     else
     {
         CompoundFile.WriteData(this, data);
     }
 }