/*
 * This file (ResourceHelper.java) is part of DebGen-LabelPrintLib  developed by ASTRID Research.
 * All rights reserved. Reproduction, modification, use or disclosure
 * to third parties without express authority is forbidden.
 *
 *  Copyright ASTRID Research, Hungary, 2010.
 *
 *  ASTRID Research
 *  Headquaters: Csapó utca 42. Debrecen H-4029 HUNGARY
 *  Phone: +36-52-533-173        Fax: +36-52-533-174
 *  Web: http://www.astrid.hu    E-mail: info@astrid.hu
 *
 * Project name: DEBGEN-Biobank-Project.
 * File last modified at 2010.01.12 10:43
 */

package hu.astrid.debgen.labelprint.test;

import java.io.*;

/**
 * Astrid Research
 * Author: inagy
 * Created: Jan 11, 2010 3:32:45 PM
 */
public class ResourceHelper {
    public String readResource(String expectedResource) throws IOException {
        InputStream stream = getClass().getResourceAsStream(expectedResource);
        BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
        String line;
        StringBuilder buffer = new StringBuilder();
        while ((line = reader.readLine()) != null) {

            buffer.append(line.replace("\r", "")).append("\n");
        }
        return buffer.toString();
    }

}
