pro.parseq.vcf.utils.InputStreamVcfReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vcf-explorer Show documentation
Show all versions of vcf-explorer Show documentation
Library for Variant Call Format (VCF) files manipulation
/*******************************************************************************
* Copyright 2016-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*******************************************************************************/
package pro.parseq.vcf.utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* {@link VcfReader} implementation based on {@link BufferedReader}
*
* @author Alexander Afanasyev [email protected]
*/
public class InputStreamVcfReader implements VcfReader {
private static final Logger logger = LoggerFactory.getLogger(InputStreamVcfReader.class);
private BufferedReader reader;
public InputStreamVcfReader(InputStream vcf) {
reader = new BufferedReader(new InputStreamReader(vcf));
}
@Override
public String readLine() {
try {
return reader.readLine();
} catch (IOException e) {
logger.error("Error while reading VCF input stream: {}", e.getMessage());
throw new RuntimeException(e.getMessage());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy