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

com.emc.mongoose.api.model.item.SingleItemInput Maven / Gradle / Ivy

There is a newer version: 4.0.0-alpha5
Show newest version
package com.emc.mongoose.api.model.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(int 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