Ithonorsboththe`maxBuffer` and `encoding`options.Thebehaviorchangesslightlybasedontheencodingchosen:
-When`encoding` is unset, it assumes an [object mode stream](https://nodesource.com/blog/understanding-object-streams/) and collects values emitted from `stream` unmodified. In this case `maxBuffer`referstothenumberofitemsinthearray(notthesumoftheirsizes).
-When`encoding` is set to `buffer`, it collects an array of buffers. `maxBuffer`referstothesummedbytelengthsofeverybufferinthearray.
-When`encoding` is set to anything else, it collects an array of strings. `maxBuffer`referstothesummedcharacterlengthsofeverystringinthearray.
##Errors
Iftheinputstreamemitsan`error` event, the promise will be rejected with the error. The buffered data will be attached to the `bufferedData`propertyoftheerror.