Commit adff59871cb4266b9540892200afff45bbd75f50
1 parent
090b8918
Exists in
master
and in
1 other branch
BugFix: bufferUnderflowExcpetion on processDataBlock().
Showing
1 changed file
with
3 additions
and
7 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/votable/votabledata/BinaryStreamParser.java
... | ... | @@ -187,13 +187,9 @@ public final class BinaryStreamParser implements DataParser { |
187 | 187 | dataBlock = stream.getLong(); |
188 | 188 | } else if (dataType.equals(DataType.CHAR)) { |
189 | 189 | String value = new String(); |
190 | - for (int i = 0; i < rowSize && cursor < stream.capacity(); i++) { | |
191 | - try { | |
192 | - value += (char) stream.get(); | |
193 | - } catch (Exception e) { | |
194 | - LOGGER.warning("Error when parsing a char." + e); | |
195 | - break; | |
196 | - } | |
190 | + for (int i = 0; i < rowSize && cursor < stream.capacity() | |
191 | + && stream.position() < stream.limit(); i++) { | |
192 | + value += (char) stream.get(); | |
197 | 193 | } |
198 | 194 | dataBlock = value.trim(); |
199 | 195 | } else if (dataType.equals(DataType.UNICODE_CHAR)) { | ... | ... |