# Decode streams into strings The Right Way(tm)```javascriptvarfs=require('fs')varzlib=require('zlib')varstrs=require('stringstream')varutf8Stream=fs.createReadStream('massiveLogFile.gz').pipe(zlib.createGunzip()).pipe(strs('utf8'))```No need to deal with `setEncoding()` weirdness, just compose streamslike they were supposed to be!Handles input and output encoding:```javascript// Stream from utf8 to hex to base64... Why not, ay.varhex64Stream=fs.createReadStream('myFile').pipe(strs('utf8','hex')).pipe(strs('hex','base64'))```Also deals with `base64` output correctly by aligning each emitted datachunk so that there are no dangling `=` characters:```javascriptvarstream=fs.createReadStream('myFile').pipe(strs('base64'))varbase64Str=''stream.on('data',function(data){base64Str+=data})stream.on('end',function(){console.log('My base64 encoded file is: '+base64Str)// Wouldn't work with setEncoding()console.log('Original file is: '+newBuffer(base64Str,'base64'))})```