@Override public void encodeValue( final BCF2Encoder encoder, final Object value, final BCF2Type type, final int minValues) throws IOException { int count = 0; if (value != null) { encoder.encodeRawInt((Integer) value, type); count++; } for (; count < minValues; count++) encoder.encodeRawMissingValue(type); }
@Override public void encodeValue( final BCF2Encoder encoder, final Object value, final BCF2Type type, final int minValues) throws IOException { int count = 0; for (final Integer i : BCF2Utils.toList(Integer.class, value)) { if (i != null) { // necessary because .,. => [null, null] in VC encoder.encodeRawInt(i, type); count++; } } for (; count < minValues; count++) encoder.encodeRawMissingValue(type); }
@Override public void encodeValue( final BCF2Encoder encoder, final Object value, final BCF2Type type, final int minValues) throws IOException { int count = 0; // TODO -- can be restructured to avoid toList operation if (isAtomic) { // fast path for fields with 1 fixed float value if (value != null) { encoder.encodeRawFloat((Double) value); count++; } } else { // handle generic case final List<Double> doubles = BCF2Utils.toList(Double.class, value); for (final Double d : doubles) { if (d != null) { // necessary because .,. => [null, null] in VC encoder.encodeRawFloat(d); count++; } } } for (; count < minValues; count++) encoder.encodeRawMissingValue(type); }