public StreamEvent copyStreamEvent(StreamEvent streamEvent) {
        StreamEvent newEvent = eventFactory.newInstance();
        if (streamEvent.getBeforeWindowData() == null) {
            newEvent.setBeforeWindowData(null);
        } else if (beforeWindowDataSize > 0) {
            System.arraycopy(streamEvent.getBeforeWindowData(), 0, newEvent.getBeforeWindowData(), 0,
                    beforeWindowDataSize);
        }
        if (onAfterWindowDataSize > 0) {
            System.arraycopy(streamEvent.getOnAfterWindowData(), 0, newEvent.getOnAfterWindowData(), 0,
                    onAfterWindowDataSize);
        }
        if (outputDataSize > 0) {
            System.arraycopy(streamEvent.getOutputData(), 0, newEvent.getOutputData(), 0, outputDataSize);
        }
        newEvent.setType(streamEvent.getType());
        newEvent.setTimestamp(streamEvent.getTimestamp());
        return newEvent;
    }
Method to copy new StreamEvent from StreamEvent

@param streamEvent StreamEvent to be copied
@return StreamEvent
modules/siddhi-core/src/main/java/io/siddhi/core/event/stream/StreamEventCloner.java