Read the next record, if any. @return true if there is a valid next record. @throws IOException when IO or format errors occur.
()
| 155 | * @throws IOException when IO or format errors occur. |
| 156 | */ |
| 157 | private boolean setNext() throws IOException { |
| 158 | final String line = mIn.readLine(); |
| 159 | if (line == null) { |
| 160 | mCurrent = null; |
| 161 | return false; |
| 162 | } |
| 163 | try { |
| 164 | mCurrent = mParser.parseLine(line); |
| 165 | if (mCurrent.getNumberOfSamples() != mNumSamples) { |
| 166 | throw new VcfFormatException("Expected " + mNumSamples + " samples, but there were " + mCurrent.getNumberOfSamples()); |
| 167 | } |
| 168 | } catch (final VcfFormatException e) { |
| 169 | throw new VcfFormatException("Invalid VCF record. " + e.getMessage() + " on line:" + line); // Add context information |
| 170 | } |
| 171 | return true; |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * closes internal streams |
no test coverage detected