public void End()
{
if (rowNum != ImgInfo.Rows - 1)
throw new PngjOutputException("all rows have not been written");
try {
datStreamDeflated.Dispose();
datStream.Dispose();
WriteLastChunks();
WriteEndChunk();
if (this.ShouldCloseStream)
outputStream.Dispose();
} catch (IOException e) {
throw new PngjOutputException(e);
}
}