diff --git a/src/main/java/eu/omp/irap/vespa/votable/votabledata/BinaryStreamParser.java b/src/main/java/eu/omp/irap/vespa/votable/votabledata/BinaryStreamParser.java index 91609e9..8e79a7c 100644 --- a/src/main/java/eu/omp/irap/vespa/votable/votabledata/BinaryStreamParser.java +++ b/src/main/java/eu/omp/irap/vespa/votable/votabledata/BinaryStreamParser.java @@ -281,6 +281,42 @@ public final class BinaryStreamParser implements DataParser { } else { dataBlock = stream.getDouble(); } + } else if (dataType.equals(DataType.FLOAT_COMPLEX)) { + if (rowSize != blockSize) { + int nb = rowSize / blockSize; + if (nb == 0) { dataBlock = ""; } + else { + StringJoiner sj = new StringJoiner(" ", "", ""); + for (int i = 0; i < nb; i++) { + sj.add(String.valueOf(stream.getFloat())); + sj.add(String.valueOf(stream.getFloat())); + } + dataBlock = sj.toString(); + } + } else { + StringJoiner sj = new StringJoiner(" ", "", ""); + sj.add(String.valueOf(stream.getFloat())); + sj.add(String.valueOf(stream.getFloat())); + dataBlock = sj.toString(); + } + } else if (dataType.equals(DataType.DOUBLE_COMPLEX)) { + if (rowSize != blockSize) { + int nb = rowSize / blockSize; + if (nb == 0) { dataBlock = ""; } + else { + StringJoiner sj = new StringJoiner(" ", "", ""); + for (int i = 0; i < nb; i++) { + sj.add(String.valueOf(stream.getDouble())); + sj.add(String.valueOf(stream.getDouble())); + } + dataBlock = sj.toString(); + } + } else { + StringJoiner sj = new StringJoiner(" ", "", ""); + sj.add(String.valueOf(stream.getDouble())); + sj.add(String.valueOf(stream.getDouble())); + dataBlock = sj.toString(); + } } else { BinaryStreamParser.LOGGER.warning("Data type " + dataType + " is not supported."); dataBlock = null; -- libgit2 0.21.2