add toStream method
add some constants