Package DataProcessing

Source Code of DataProcessing.SimpleInputDataProcessor

package DataProcessing;

import DataProcessing.Exceptions.DataWriteException;
import DataProcessing.Exceptions.DataReadException;
import DataProcessing.Exceptions.InputTestReadException;
import DataProcessing.Exceptions.InputWriteException;
import FileOperations.FileOperator;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.util.ArrayList;

/**
*
* @author partizanka
*/
public class SimpleInputDataProcessor extends InputDataProcessor {

    /**
     *
     * @param inputWriter
     * @param testInputReader
     * @throws InputTestReadException
     * @throws InputWriteException
     */
    public void process(BufferedWriter inputWriter, BufferedReader testInputReader)
            throws InputTestReadException, InputWriteException {
        ArrayList<String> lines;
        try {
            lines = super.read(testInputReader);
            super.write(inputWriter, lines);
        } catch (DataReadException e) {
            throw new InputTestReadException(e.toString());
        } catch (DataWriteException e) {
            throw new InputWriteException(e.toString());
        } finally {
            FileOperator.close(inputWriter);
            FileOperator.close(testInputReader);
        }
    }
}
TOP

Related Classes of DataProcessing.SimpleInputDataProcessor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.