droolsStream = (DroolsObjectOutputStream) out;
} else {
bytes = new ByteArrayOutputStream();
droolsStream = new DroolsObjectOutputStream( bytes );
}
droolsStream.writeObject( rules );
droolsStream.writeObject( idGenerator );
droolsStream.writeBoolean( ordered );
if ( !isDrools ) {
bytes.close();
out.writeObject( bytes.toByteArray() );