All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.darwinsys.io.ByteArrayDumpGetter Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package com.darwinsys.io;

/** A Getter that reads from an in-memory array of bytes */
public class ByteArrayDumpGetter implements DumpSource {

	private byte[] data;
	private int offset;
	private int max;
	
	public ByteArrayDumpGetter(byte[] d) {
		data = d;
		offset = 0;
		max = data.length;
	}

	public int get() {
		if (offset < max)
			return data[offset++];
		return -1;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy