/// <summary> /// init: is called automatically before writing the first row /// </summary> private void Init() { datStream = new PngIDatChunkOutputStream(this.outputStream, this.IdatMaxSize); datStreamDeflated = ZlibStreamFactory.CreateZlibOutputStream(datStream, this.CompLevel, this.CompressionStrategy, true); WriteSignatureAndIHDR(); WriteFirstChunks(); }
/// <summary> /// init: is called automatically before writing the first row /// </summary> private void Init() { datStream = new PngIDatChunkOutputStream(outputStream, IdatMaxSize); datStreamDeflated = new ZlibOutputStream(datStream, CompLevel, CompressionStrategy, true); WriteSignatureAndIHDR(); WriteFirstChunks(); }
// this generates 2000 files! static public void testGenerateAll() { long t0 = Environment.TickCount; Random r = new Random(); for (int n = 0; n < 2000; n++) { Stream bos = new FileStream("C:/temp/z/zlibcs" + n + ".bin", FileMode.Create); AZlibOutputStream ost = ZlibStreamFactory.createZlibOutputStream(bos, false); if (n == 0) { Console.WriteLine("Using: " + ost); } byte[] b = createBytes7(n < 50 ? n : n * n - 7); int offset = 0; while (offset < b.Length) { int len = r.Next(b.Length - offset) + 1; ost.Write(b, offset, len); offset += len; } ost.Close(); } long t1 = Environment.TickCount; Console.WriteLine("generated 2000 files in " + (t1 - t0)); }
public void init() { datStream = new PngIDatChunkOutputStream(outputStream, IdatMaxSize); datStreamDeflated = ZlibStreamFactory.createZlibOutputStream(datStream, CompLevel, CompressionStrategy, leaveOpen: true); WriteSignatureAndIHDR(); WriteFirstChunks(); }