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

com.emc.mongoose.base.item.io.SingleItemInput Maven / Gradle / Ivy

There is a newer version: 4.3.10
Show newest version
package com.emc.mongoose.base.item.io;

import com.emc.mongoose.base.item.Item;
import com.github.akurilov.commons.io.Input;
import java.util.List;

/** Created by andrey on 28.04.16. */
public class SingleItemInput implements Input {

	private final T item;

	public SingleItemInput(final T item) {
		this.item = item;
	}

	@Override
	public final T get() {
		return item;
	}

	@Override
	public final int get(final List buffer, final int limit) {
		for (var i = 0; i < limit; i++) {
			buffer.add(item);
		}
		return limit;
	}

	@Override
	public final long skip(final long count) {
		return count;
	}

	@Override
	public final void reset() {}

	@Override
	public final void close() {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy