CDFILEHEADER header = (CDFILEHEADER) record;
totalSegments = header.getSegCount();
segmentCount = 0;
}
if (record instanceof CDFILESEGMENT) {
CDFILESEGMENT seg = (CDFILESEGMENT) record;
ByteBuffer data = ByteBuffer.wrap(seg.getFileData());
data.order(ByteOrder.LITTLE_ENDIAN);
try {
os.write(data.array(), data.position(), data.limit() - data.position());
} catch (IOException e) {
throw new RuntimeException(e);