// Path: src/main/java/org/archive/util/io/PushBackOneByteInputStream.java
// public interface PushBackOneByteInputStream {
// 	public void pushback() throws IOException;
// 	public int read() throws IOException;
// }


import java.io.IOException;
import java.io.OutputStream;
import java.io.InputStream;
import org.archive.util.io.PushBackOneByteInputStream;

				total += amtRead;
            }
		}
		return total;
	}

	public static long readToEOF(InputStream i) throws IOException {
		return readToEOF(i,DEFAULT_READ_SIZE);
	}
	public static long readToEOF(InputStream i, int bufferSize) throws IOException {
		long numBytes = 0;
		byte buffer[] = new byte[bufferSize];
		while(true) {
			int amt = i.read(buffer,0,bufferSize);
			if(amt == -1) {
				return numBytes;
			}
			numBytes += amt;
		}
	}
	public static long readToEOFSingle(InputStream i) throws IOException {
		long numBytes = 0;
		while(true) {
			int c = i.read();
			if(c == -1) {
				return numBytes;
			}
			numBytes++;
		}
	}

// Path: src/main/java/org/archive/util/io/PushBackOneByteInputStream.java
// public interface PushBackOneByteInputStream {
// 	public void pushback() throws IOException;
// 	public int read() throws IOException;
// }


// Path: src/main/java/org/archive/util/StreamCopy.java
import java.io.IOException;
import java.io.OutputStream;
import java.io.InputStream;
import org.archive.util.io.PushBackOneByteInputStream;

				total += amtRead;
            }
		}
		return total;
	}

	public static long readToEOF(InputStream i) throws IOException {
		return readToEOF(i,DEFAULT_READ_SIZE);
	}
	public static long readToEOF(InputStream i, int bufferSize) throws IOException {
		long numBytes = 0;
		byte buffer[] = new byte[bufferSize];
		while(true) {
			int amt = i.read(buffer,0,bufferSize);
			if(amt == -1) {
				return numBytes;
			}
			numBytes += amt;
		}
	}
	public static long readToEOFSingle(InputStream i) throws IOException {
		long numBytes = 0;
		while(true) {
			int c = i.read();
			if(c == -1) {
				return numBytes;
			}
			numBytes++;
		}
	}

	public static long skipChars(PushBackOneByteInputStream i, int [] skips) throws IOException {
