Event-based Compression and Mining of Data Streams