tmpFits.addHDU(votMetaHdu);
tmpFits.addHDU(hdu);
votMetaHdu.getHeader().removeCard("EXTNAME"); // not expected by FitsPlusTableBuilder
votMetaHdu.getHeader().removeCard("EXTEND"); // not expected by FitsPlusTableBuilder
ByteArrayOutputStream os = new ByteArrayOutputStream();
BufferedDataOutputStream bos = new BufferedDataOutputStream(os);
tmpFits.write(bos);
bos.flush();
// Restore the name that was removed above
votMetaHdu.getHeader().addValue("EXTNAME", votMetaName, "Table metadata in VOTable format");
ByteArrayDataSource dataSrc = new ByteArrayDataSource(filename, os.toByteArray());
bos.close();
StarTable starTable = new FitsPlusTableBuilder().makeStarTable(dataSrc, true,
StoragePolicy.getDefaultPolicy());
dataSrc.close();
VoTable table = VoTable.createVoTable(starTable, null, 1000000);
table.setName(name);