public StandardFigureSelection(FigureEnumeration figures, int figureCount) {
// a FigureSelection is represented as a flattened ByteStream
// of figures.
ByteArrayOutputStream output = new ByteArrayOutputStream(200);
StorableOutput writer = new StorableOutput(output);
writer.writeInt(figureCount);
while (figures.hasMoreElements()) {
writer.writeStorable(figures.nextFigure());
}
writer.close();
fData = output.toByteArray();