src/main/java/gov/usgs/cida/pubs/transform/XlsxTransformer.java
@Override
	protected void init() throws IOException {
		if (null == workbook) {
			workbook = new XSSFWorkbook();
		}

		if (null == sheet) {
			sheet = workbook.createSheet(sheetName);
		}

		sheetRef = sheet.getPackagePart().getPartName().getName().substring(1);
		zos = new ZipOutputStream(target);

		// stream the template - don't include the empty sheet (sheetRef).
		ByteArrayOutputStream os = new ByteArrayOutputStream();
		workbook.write(os);
		ZipInputStream strm = new ZipInputStream(new ByteArrayInputStream(os.toByteArray()));
		ZipEntry ze;
		while (null != (ze = strm.getNextEntry())) {
			if (!ze.getName().equals(sheetRef)) {
				zos.putNextEntry(new ZipEntry(ze.getName()));
				copyStream(strm, zos);
			}
		}
	}
/**
	 * Initialize a workbook if needed, a sheet to work on and write the
	 * template to the stream.
	 * 
	 * @throws IOException when issues with the streaming.
	 */
Initialize a workbook if needed, a sheet to work on and write the
template to the stream.

@throws IOException when issues with the streaming.
Initialize a workbook if needed a sheet to work on and write the template to the stream . @throws IOException when issues with the streaming .
@Override
	protected void init() throws IOException {
		if (null == workbook) {
			workbook = new XSSFWorkbook();
		}
		if (null == sheet) {
			sheet = workbook.createSheet(sheetName);
		}
		sheetRef = sheet.getPackagePart().getPartName().getName().substring(1);
		zos = new ZipOutputStream(target);
		ByteArrayOutputStream os = new ByteArrayOutputStream();
		workbook.write(os);
		ZipInputStream strm = new ZipInputStream(new ByteArrayInputStream(os.toByteArray()));
		ZipEntry ze;
		while (null != (ze = strm.getNextEntry())) {
			if (!ze.getName().equals(sheetRef)) {
				zos.putNextEntry(new ZipEntry(ze.getName()));
				copyStream(strm, zos);
			}
		}
	}
@ Override protected void init ( ) throws IOException { if ( null == workbook ) { workbook = new XSSFWorkbook ( ) ; } if ( null == sheet ) { sheet = workbook . createSheet ( sheetName ) ; } sheetRef = sheet . getPackagePart ( ) . getPartName ( ) . getName ( ) . substring ( 1 ) ; zos = new ZipOutputStream ( target ) ; ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; workbook . write ( os ) ; ZipInputStream strm = new ZipInputStream ( new ByteArrayInputStream ( os . toByteArray ( ) ) ) ; ZipEntry ze ; while ( null != ( ze = strm . getNextEntry ( ) ) ) { if ( ! ze . getName ( ) . equals ( sheetRef ) ) { zos . putNextEntry ( new ZipEntry ( ze . getName ( ) ) ) ; copyStream ( strm , zos ) ; } } }
Initialize a workbook if needed, a sheet to work on and write the
 template to the stream.
Initialize a workbook if needed a sheet to work on and write the template to the stream .
// stream the template - don't include the empty sheet (sheetRef).