You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public void Test()
{
var cf = new CompoundFile();
const string DATA = "data";
var st = cf.RootStorage.AddStream(DATA);
const int size = 10;
var data = Enumerable.Range(0, size).Select(v => (byte)v).ToArray();
st.SetData(data);
var ms = new MemoryStream();
cf.Save(ms);
cf.Close();
ms.Position = 0;
cf = new CompoundFile(ms, CFSUpdateMode.Update, CFSConfiguration.Default);
st = cf.RootStorage.GetStream(DATA);
st.Resize(5); // <- can be any number smaller than the current size
st.Write(new byte[] { 0 }, 0); // <- exception here!
cf.Commit();
cf.Close();
}
Looks like truncating the stream does not work.
The text was updated successfully, but these errors were encountered:
Looks like truncating the stream does not work.
The text was updated successfully, but these errors were encountered: