add export format enum and allow export to output stream

What about to add value to enum instead of ....name().toLowerCase() ?