CsvProductWriter extends AbstractProductWriter { private void writeHeader() throws IOException { final Band[] bands = getSourceProduct().getBands(); StringBuilder builder = new StringBuilder(); builder.append(getFeatureIdColumnNameFromMetadata()); for (final Band band : bands) { builder.append(separator); builder.append(band.getName()); builder.append(":"); final int dataType = band.getGeophysicalImage().getData().getDataBuffer().getDataType(); builder.append(getJavaType(dataType)); } final TiePointGrid[] tiePointGrids = getSourceProduct().getTiePointGrids(); for (final TiePointGrid tpg : tiePointGrids) { builder.append(separator); builder.append(tpg.getName()); builder.append(":"); final int dataType = tpg.getGeophysicalImage().getData().getDataBuffer().getDataType(); builder.append(getJavaType(dataType)); } writeLine(builder.toString()); } CsvProductWriter(ProductWriterPlugIn plugIn, int config, Writer writer); @Override void writeBandRasterData(Band sourceBand, int sourceOffsetX, int sourceOffsetY,
                                    int sourceWidth, int sourceHeight, ProductData sourceBuffer,
                                    ProgressMonitor pm); @Override void flush(); @Override void close(); @Override void deleteOutput(); static final int WRITE_PROPERTIES; static final int WRITE_FEATURES; }
@Test public void testWriteHeader() throws Exception { assertEquals("featureId\tradiance_1:float\tradiance_2:double\tradiance_3:int", result.toString().trim()); }