public static ObjectOutputter createObjectOutputter(
        final FileOutputStream out,
        final SyncType type,
        final int batchSize,
        final EventSerializer eventSerializer
    ) throws IOException
    {
        if (eventSerializer == null) {
            return createObjectOutputter(out, type, batchSize);
        }

        switch (type) {
            case NONE:
                return new DefaultObjectOutputter(out, eventSerializer);
            case FLUSH:
                return new FlushingObjectOutputter(out, eventSerializer, batchSize);
            case SYNC:
                return new SyncingObjectOutputter(out, eventSerializer, batchSize);
        }

        throw new IllegalArgumentException("Unable to construct ObjectOutputter given type" + type);
    }
public static ObjectOutputter createObjectOutputter ( final FileOutputStream out , final SyncType type , final int batchSize , final EventSerializer eventSerializer ) throws IOException { if ( eventSerializer == null ) { return createObjectOutputter ( out , type , batchSize ) ; } switch ( type ) { case NONE : return new DefaultObjectOutputter ( out , eventSerializer ) ; case FLUSH : return new FlushingObjectOutputter ( out , eventSerializer , batchSize ) ; case SYNC : return new SyncingObjectOutputter ( out , eventSerializer , batchSize ) ; } throw new IllegalArgumentException ( "Unable to construct ObjectOutputter given type" + type ) ; }
@param out             underlying FileOutputStream
@param type            type of outputter (flush, sync, ...)
@param batchSize       number of events between flushes or syncs
@param eventSerializer does not have to be tied to 'out'. We will call eventSerializer.open(out) later.
If eventSerializer == null, it's the same as calling the default createObjectOutputter()
@return a new outputter object of type type
@throws IOException when unable to open the FileOutputStream out