stream reader/writer for base128 format