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

fr.insee.eno.preprocessing.NoopPreprocessor Maven / Gradle / Ivy

Go to download

Eno is a tool that generates survey questionnaires starting from their formal description in DDI

The newest version!
package fr.insee.eno.preprocessing;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.ByteArrayOutputStream;
import java.io.InputStream;

/**
 * No-op preprocessor.
 */
public class NoopPreprocessor implements Preprocessor {

	private static final Logger logger = LoggerFactory.getLogger(NoopPreprocessor.class);

//	@Override
//	public File process(File inputFile, byte[] parameters, String survey, String in2out) throws Exception {
//		logger.info("No-op preprocessor, simply returning generated file.");
//		// Identity
//		return inputFile;
//	}

	@Override
	public ByteArrayOutputStream process(InputStream inputStream, byte[] parameters, String survey, String in2out) throws Exception {
		ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
		byteArrayOutputStream.write(inputStream.readAllBytes());
		inputStream.close();
		return byteArrayOutputStream;
	}

	@Override
	public String toString() {
		return "No-op preprocessor";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy