Closed ArminFirecracker closed 6 years ago
As I see, CFStreams cannot be larger than 2GB? Running the test code, I get an Exception. Probably it is not intended to support such large streams?
In StreamView.cs, line 319:
Buffer.BlockCopy( buffer, offset, sectorChain[secOffset].GetData(), secShift, roundByteWritten );
Exception:
System.ArgumentOutOfRangeException: 'Non-negative number required.
Test code:
String filename = "MyFile.dat"; String storageName = "MyStorage"; String streamName = "MyStream"; int bufferSize = 500000000; int iterationCount = 6; int streamCount = 1; CompoundFile compoundFile = new CompoundFile(CFSVersion.Ver_4, CFSConfiguration.Default); CFStorage st = compoundFile.RootStorage.AddStorage(storageName); for (int streamId = 0; streamId < streamCount; ++streamId) { CFStream sm = st.AddStream(streamName + streamId); for (int iteration = 0; iteration < iterationCount; ++iteration) { sm.Append(new byte[bufferSize]); } } compoundFile.Save(filename); compoundFile.Close();
And thank you, for your fast respond on https://github.com/ironfede/openmcdf/issues/14!
Committed to master bug fix and unit test. Many thanks ArminFirecracker. Please , let me know if you find other stream/file size issues. Release will follow asap. Best Regards, Federico
As I see, CFStreams cannot be larger than 2GB? Running the test code, I get an Exception. Probably it is not intended to support such large streams?
In StreamView.cs, line 319:
Exception:
Test code:
And thank you, for your fast respond on https://github.com/ironfede/openmcdf/issues/14!