// Path: src/main/java/com/ryantenney/passkit4j/io/InputStreamSupplier.java
// public interface InputStreamSupplier {
// 
// 	public InputStream getInputStream() throws IOException;
// 
// }


import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import com.ryantenney.passkit4j.io.InputStreamSupplier;
package com.ryantenney.passkit4j;



public class BufferedPassResource extends PassResource {

	private static final int DEFAULT_BUFFER_SIZE = 32768;

	public BufferedPassResource(final String filename) throws IOException {
		this(new File(filename));
	}

	public BufferedPassResource(final File file) throws IOException {
		this(file.getName(), file);
	}

	public BufferedPassResource(final String name, final File file) throws IOException {
		this(name, read(new FileInputStream(file), (int) file.length()));
	}

// Path: src/main/java/com/ryantenney/passkit4j/io/InputStreamSupplier.java
// public interface InputStreamSupplier {
// 
// 	public InputStream getInputStream() throws IOException;
// 
// }


// Path: src/main/java/com/ryantenney/passkit4j/BufferedPassResource.java
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import com.ryantenney.passkit4j.io.InputStreamSupplier;

package com.ryantenney.passkit4j;



public class BufferedPassResource extends PassResource {

	private static final int DEFAULT_BUFFER_SIZE = 32768;

	public BufferedPassResource(final String filename) throws IOException {
		this(new File(filename));
	}

	public BufferedPassResource(final File file) throws IOException {
		this(file.getName(), file);
	}

	public BufferedPassResource(final String name, final File file) throws IOException {
		this(name, read(new FileInputStream(file), (int) file.length()));
	}

	public BufferedPassResource(final String name, final InputStreamSupplier dataSupplier) throws IOException {