compress: convert from Buffer or String in c++ land