create a snapshot example code

Hello,
Am pretty new in ES, has anyone a sample java code for creating a snapshot and reading from snapshot for an Aggregate?
Another language will be also appreciate.

Cheers
William