<commit_before>package ork.sevenstates.apng;

import java.awt.Dimension;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.WritableByteChannel;
import java.util.Map;

import ork.sevenstates.apng.optimizing.Identity;
import ork.sevenstates.apng.optimizing.Optimizer;

public class APNGWriter extends AbstractAPNGWriter {
	private final WritableByteChannel out;
	private boolean closed = false;
	private int frameCount = 0;

	private boolean initialized;
	private int frameCountEnd;

	public APNGWriter(File f, int alg) throws FileNotFoundException {
		this(f, alg, new Identity());
	}
	
	public APNGWriter(String fName, int alg) throws FileNotFoundException {
		this(new File(fName), alg);
	}
	
	@SuppressWarnings("resource") //Channel will close stream
	public APNGWriter(File f, int alg, Optimizer optimizer) throws FileNotFoundException {
		this(new FileOutputStream(f).getChannel(), alg, optimizer);
	}
	
	public APNGWriter(OutputStream os, int alg, Optimizer optimizer) {
		this(Channels.newChannel(os), alg, optimizer);
	}
	
	public APNGWriter(WritableByteChannel out, int alg, Optimizer optimizer) {
		super(alg, optimizer);
		this.out = out;
	}<commit_msg>remove a leftover from refactoring, fix double closing<commit_after>package ork.sevenstates.apng;

import java.awt.Dimension;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.WritableByteChannel;
import java.util.Map;

import ork.sevenstates.apng.optimizing.Identity;
import ork.sevenstates.apng.optimizing.Optimizer;

public class APNGWriter extends AbstractAPNGWriter {
	private final WritableByteChannel out;
	private int frameCount = 0;

	private boolean initialized;
	private int frameCountEnd;

	public APNGWriter(File f, int alg) throws FileNotFoundException {
		this(f, alg, new Identity());
	}
	
	public APNGWriter(String fName, int alg) throws FileNotFoundException {
		this(new File(fName), alg);
	}
	
	@SuppressWarnings("resource") //Channel will close stream
	public APNGWriter(File f, int alg, Optimizer optimizer) throws FileNotFoundException {
		this(new FileOutputStream(f).getChannel(), alg, optimizer);
	}
	
	public APNGWriter(OutputStream os, int alg, Optimizer optimizer) {
		this(Channels.newChannel(os), alg, optimizer);
	}
	
	public APNGWriter(WritableByteChannel out, int alg, Optimizer optimizer) {
		super(alg, optimizer);
		this.out = out;
	}
{'fraction_non_alphanumeric': 0.09611380985426787, 'fraction_numerical': 0.0006939625260235947, 'mean_word_length': 5.735981308411215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6440349', 'n_tokens_mistral': 906, 'n_tokens_neox': 874, 'n_words': 233}