incorporate all changes suggested by pawel
add param to specify reader/writer
add Compression util method
NPE fix