move buffer possition to end after read
fix computation of written bytes when bytes are written one by one
add null compressor for testing