public int serialize( int offset, byte[] data ) {LOG.log( DEBUG, "Serializing Workbook with offsets" );int pos = 0;SSTRecord lSST = null;int sstPos = 0;boolean wroteBoundSheets = false;for ( org.apache.poi.hssf.record.Record record : records.getRecords() ) {int len = 0;if (record instanceof SSTRecord) {lSST = (SSTRecord)record;sstPos = pos;}if (record.getSid() == ExtSSTRecord.sid && lSST != null) {record = lSST.createExtSSTRecord(sstPos + offset);}if (record instanceof BoundSheetRecord) {if(!wroteBoundSheets) {for (BoundSheetRecord bsr : boundsheets) {len += bsr.serialize(pos+offset+len, data);}wroteBoundSheets = true;}} else {len = record.serialize( pos + offset, data );}pos += len;}LOG.log( DEBUG, "Exiting serialize workbook" );return pos;}